【发布时间】:2017-03-10 17:45:03
【问题描述】:
我尝试索引包含日期的字段。
如何索引不同时区的日期?
我已经像这样设置了我的 elasticsearch 字段: 'requested_dt': {"type": "date", "format": "date_time_no_millis"} 'local_dt': {"type": "date", "format": "date_time_no_millis"}
我试图索引这些值(local_dt): (requested_dt 为法国当前时间)
IT 2016-10-27T23:46:17Z
GB 2016-10-27T22:46:19Z
我没有通过 Kibana 得到预期的结果:
[local_dt]
IT October 28th 2016, 01:46:17.000
GB October 28th 2016, 00:46:19.000
[requested_dt]
IT October 27th 2016, 23:46:17.000
GB October 27th 2016, 23:46:19.000
所以,对于 requested_dt,我得到了我的期望。
对于 local_dt,我没有得到我想要的。
我尝试将 Z 值替换为 UTC 偏移量,但无法获得正确的输出。
是否有人能够向我解释如何为我想要的每个时区获得正确的输出?
【问题讨论】:
-
你试过
logstash中的日期过滤器吗? -
我没有使用logstash;只是尝试使用 python 发送值
标签: datetime elasticsearch timezone kibana timezone-offset