Open liketic opened 5 years ago
@liketic seems something wrong with default time-zone in Py2
Solution1: Append time-zone info instead
aliyunlog log get_log --project=xxx --logstore=xxx --access-id=xxx --access-key=xxxx --region-endpoint=cn-zhangjiakou.log.aliyuncs.com --query='*| select DISTINCT("listener_info.listener_id") limit 2000' --from_time='5 min ago' --to_time='now' ==>
aliyunlog log get_log --project=xxx --logstore=xxx --access-id=xxx --access-key=xxxx --region-endpoint=cn-zhangjiakou.log.aliyuncs.com --query='*| select DISTINCT("listener_info.listener_id") limit 2000' --from_time='5 min ago UTC+8' --to_time='now UTC+8'
Solution2: change to Python 3
I will update doc accordingly.
The following command
aliyunlog log get_log --project=xxx --logstore=xxx --access-id=xxx --access-key=xxxx --region-endpoint=cn-zhangjiakou.log.aliyuncs.com --query='*| select DISTINCT("listener_info.listener_id") limit 2000' --from_time='5 min ago' --to_time='now'
returns different result for python2 and python3.
version:
More details: Python 3.6.6:
Python 2.7.8: