我是 ElasticSearch 和 Kibana 的新手,无法让 Kibana 识别我的时间戳。
我有一个包含大量数据的 JSON 文件,我希望使用 Curl 将其插入到 Elasticsearch 中。以下是其中一个 JSON 条目的示例。
{"index":{"_id":"63"}}
{"account_number":63,"firstname":"Hughes","lastname":"Owens", "email":"hug[email protected] /cdn-cgi/l/email-protection", "_timestamp":"2013-07-05T08:49:30.123"}
我尝试使用以下命令在 Elasticsearch 中创建索引:
curl -XPUT 'http://localhost:9200/test/'
然后我尝试为时间戳设置适当的映射:
curl -XPUT 'http://localhost:9200/test/container/_mapping' -d'
{
"container" : {
"_timestamp" : {
"_timestamp" : {"enabled: true, "type":"date", "format": "date_hour_minute_second_fraction", "store":true}
}
}
}'
// 时间戳格式http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-date-format.html http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-date-format.html
然后我尝试批量插入我的数据:
curl -XPOST 'localhost:9200/test/container/_bulk?pretty' --data-binary @myfile.json
所有这些命令都可以正常运行,但是在 Kibana 中查看数据时,_timestamp 字段无法被识别。通过时间戳排序不起作用,并且尝试使用不同时间段过滤数据也不起作用。关于为什么会出现此问题的任何想法都值得赞赏。