Intro ElasticSearch Stored TimeZone

Intro ElasticSearch Stored TimeZone

這篇介紹ElasticSearch Stored TimeZone。

關於時區

1
2
3
4
5
在ElasticSearch的世界裡,儲存的時區都是以UTC+0為主。
若系統預設時區是GMT+8,要使用RestHighLevelApi去ElasticSearch查詢
必須將時間欄位從GMT+8時區轉換成UTC+0才能正確查詢。

在ElasticSearch的index也是用UTC+0時區建立。

例外

1
2
在Kibana上,下KQL因Kibana預設時區是GMT+8。
所以不用再特地將時間從GMT+8轉換成UTC+0。