搜索结果正在快递途中

es 存储 dd/MM/yyyy:HH:mm:ss Z 格式的date 类型的问题

Elasticsearch | 作者 jinxin343 | 发布于2017年08月16日 | 阅读数:4839

我在template里面已经设置了dd/MM/yyyy:HH:mm:ss Z的format,但是存储的时候还是报错。

"timestamp": {
"format": "dd/MM/yyyy:HH:mm:ss Z||yyyy-MM-dd||epoch_millis",
"type": "date"
}

报错如下:
[2017-08-16T14:08:19,989][WARN ][logstash.outputs.elasticsearch] Failed action. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"acc-log-2017-08-16", :_type=>"log", :_routing=>nil}, 2017-08-16T06:08:18.762Z %{host} %{message}], :response=>{"index"=>{"_index"=>"acc-log-2017-08-16", "_type"=>"log", "_id"=>"AV3pqDAPo2yXn8X7WchM", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [timestamp]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: \"16/Aug/2017:14:08:09 +0800\" is malformed at \"Aug/2017:14:08:09 +0800\""}}}}}
已邀请:

xinfanwang

赞同来自:

数据本来的格式是啥?
16/08/2017:06:08:18 +0800 ? 按你的mapping定义,这样才是符合格式的时间串。

要回复问题请先登录注册