我的映射关系如下
"start_time": {
"format": "yyyy‐MM‐dd HH:mm:ss",
"type": "date"
}
pub_time": {
"format": "yyyy‐MM‐dd HH:mm:ss",
"type": "date"
都是这种映射
数据库里的格式
是这种 :
2019-12-28 19:24:41
但是在采集数据的时候报解析异常
Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"4028e58161bd3b380161bd3bcd2f0000", :_index=>"xc_course", :_type=>"doc", :_routing=>nil}, #LogStash::Event:0x62e0a8f9], :response=>{"index"=>{"_index"=>"xc_course", "_type"=>"doc", "_id"=>"4028e58161bd3b380161bd3bcd2f0000", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [start_time]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: \"2019-12-20T15:18:13.000Z\" is malformed at \"-12-20T15:18:13.000Z\""}}}}}
主要是这一句
failed to parse [start_time]", "caused_by"=>{"type"=>"illegal_argument_exception"
** "Invalid format: \"2019-12-20T15:18:13.000Z\" is malformed at \"-12-20T15:18:13.000Z\""**
然后就导致无法采集到索引库
但是吧时间都设置为null值之后却又可以采集到索引库
这是怎么回事 又怎么解决呢?