我是ElasticSearch和Kibana的新手,很難讓Kibana識別我的時間戳。識別Kibana和ElasticSearch中的時間戳
我有一個JSON文件,裏面有很多我想用Curl插入Elasticsearch的數據。以下是其中一個JSON條目的示例。
{"index":{"_id":"63"}}
{"account_number":63,"firstname":"Hughes","lastname":"Owens", "email":"[email protected]", "_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
然後我試圖批量插入我的數據:
curl -XPOST 'localhost:9200/test/container/_bulk?pretty' --data-binary @myfile.json
所有這些命令的運行,而不但是當數據以Kibana被觀看的_timestamp場不被認可的錯。通過時間戳排序不起作用,嘗試使用不同的時間段過濾數據不起作用。關於這個問題發生的原因的任何想法都受到了應用。
你的數據本身具有_timestamp領域JSON鍵值對?映射是否使elasticsearch插入時間戳? – liv2hak 2015-03-31 21:00:37
使用最新版本的Elastic Search(5.1.1)我必須使用以下格式:''timestamp「:」2016-12-15T11:34:10.000「'。請注意'T'和字段名稱'_timestamp'未被接受。 – Marc 2016-12-15 15:04:34
@Marc非常感謝你!在日期和時間之間使用「T」在5.3上仍然運行良好 – Marcel 2017-04-16 08:24:55