elasticsearch 带时区和扩展边界的Elasticsearch日期直方图
在Elasticsearch 2.x中,我进行了日期直方图聚合,需要设置elasticsearch 带时区和扩展边界的Elasticsearch日期直方图,elasticsearch,grafana,elasticsearch,Grafana,在Elasticsearch 2.x中,我进行了日期直方图聚合,需要设置时区和扩展边界选项: ... "date_histogram": { "interval": "1d", "field": "time", "min_doc_count": 0, "format": "epoch_millis", "time_zone": "Europe/Rome", "extended_bounds": { "min": "1496268000000", "max"
时区
和扩展边界
选项:
...
"date_histogram": {
"interval": "1d",
"field": "time",
"min_doc_count": 0,
"format": "epoch_millis",
"time_zone": "Europe/Rome",
"extended_bounds": {
"min": "1496268000000",
"max": "1498859999999"
}
}
...
它返回错误无法解析格式为[epoch_millis]
的日期字段[14962680000],但对我来说没有意义,因为该值实际上以毫秒为单位:
实际上,我正在使用Grafana并试图找到解决方法。我已经解决了我的问题:
min
和max
的扩展边界必须是数字,而不是字符串:
"extended_bounds": {
"min": 1496268000000,
"max": 1498859999999
}
如前所述,我正在使用Grafana,所以问题就出在那里。修复了该问题(请参阅对datasource.js
的更改)
"extended_bounds": {
"min": 1496268000000,
"max": 1498859999999
}