我是ElasticSearch和Kibana的新手,我很难让Kibana认出我的时间戳.
我有一个JSON文件,其中包含许多我希望使用Curl插入Elasticsearch的数据.以下是其中一个JSON条目的示例.
{"index":{"_id":"63"}}
{"account_number":63,"firstname":"Hughes","lastname":"Owens", "email":"hughesowens@valpreal.com", "_timestamp":"2013-07-05T08:49:30.123"}
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下命令在Elasticsearch中创建索引:
curl -XPUT 'http://localhost:9200/test/'
Run Code Online (Sandbox Code Playgroud)
然后我尝试为时间戳设置适当的映射:
curl -XPUT 'http://localhost:9200/test/container/_mapping' -d'
{
"container" : {
"_timestamp" : {
"_timestamp" : {"enabled: true, "type":"date", "format": "date_hour_minute_second_fraction", "store":true}
}
}
}'
Run Code Online (Sandbox Code Playgroud)
//来自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
Run Code Online (Sandbox Code Playgroud)
所有这些命令都运行无故障,但是当在Kibana中查看数据时,_timestamp字段无法被识别.通过时间戳排序不起作用,尝试使用不同的句点过滤数据不起作用.关于为什么会出现这个问题的任何想法都是昂贵的.