elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

ES query with local time timestamp

Open adolia opened this issue 8 years ago • 4 comments

Hello there! Is it possible to perform queries to ElasticSearch using local time instead of UTC? Because all docs in ES stored with local time format.

Thanks in advanced.

adolia avatar Jan 25 '18 13:01 adolia

I also met this problem. Have you solved this problem? @adolia

Samuel-Gong avatar Apr 09 '19 09:04 Samuel-Gong

No it's not possible. Why is it a problem? If you want to specify locals times with --start and --end, you can. For example, elastalert --verbose --start 2019-04-07T12:00:00-08:00

Qmando avatar Apr 09 '19 17:04 Qmando

No it's not possible. Why is it a problem? If you want to specify locals times with --start and --end, you can. For example, elastalert --verbose --start 2019-04-07T12:00:00-08:00

But if I have two indices in Elasticsearch, the timestamp of one is stored with local time format, like 2019-04-07T12:00:00+08:00, and the timestamp of another is stored with UTC format, like 2019-04-07T12:00:00Z. How can I perform the right queries to Elasticsearch?

Samuel-Gong avatar Apr 14 '19 16:04 Samuel-Gong

+1, I need to use index filebeat-%Y.%m.%d, with UTC time, the filebeat-2020.09.25 is not created when I run the rule on Sep 24 22:39:39 PDT 2020

pingwang avatar Sep 25 '20 05:09 pingwang