elasticsearch - elasticsearch / kibana错误的纪元日期索引
问题描述
elastichsearch 或 kibana 从纪元索引开始出现错误的日期。
the date value is: 1495956650 (human date: GMT: Sunday, May 28, 2017 7:30:50 AM)
但是......当将此记录索引到具有以下映射的elasticsearch时:
PUT test
{
"mappings": {
"doc": {
"properties": {
"date": {
"properties": {
"value": {
"type": "date"
}
}
}
}
}
}
}
何时发布此数据:
POST test/doc
{"date": {
"value": "1495956650"
}
}
我在索引模式之后在 kibana 中看到了这个日期,那是错误的!
date.value:January 18th 1970, 11:02:36.650
我的 elasticsearch 和 kibana 版本都是 6.2.3,我的系统时间是更新的。
解决方案
看起来 elasticsearch 已经“猜测”epoch_millis
而不是epoch_second
.
您需要按如下方式调整映射:
PUT test
{
"mappings": {
"doc": {
"properties": {
"date": {
"properties": {
"value": {
"type": "date",
"format": "epoch_second"
}
}
}
}
}
}
}
有关此处提供的弹性搜索日期格式的更多信息
推荐阅读
- mysql - 永远的 SQL 查询
- r - 合并线型和颜色时图例键重叠
- spring-boot - 如何在 Windows 上部署的独立项目中创建 Spring Boot 日志?
- c++ - 如何将 PEGTL 解析器与单独的词法分析器一起使用?
- android - 如何设计 CardView 使其彼此相邻?
- python - AttributeError: 'list' object has no attribute 'click' 错误点击使用 Selenium 和 Python 的元素
- git - 将主 Git 存储库合并到私有存储库的最佳方法,如果私有存储库几乎没有更改
- json - TypeError:“列”类型的对象不是 JSON 可序列化的
- arrays - 如何避免在循环时跳过数组的元素
- c# - 从列表框控件构建 SQL IN 语句 Return Nothing