Hi all,
When I am trying to insert date from logstash to elasticsearch, following error appears.
"error"=>{
"type"=>"mapper_parsing_exception",
"reason"=>"failed to parse [data.time]",
"caused_by"=>{
"type"=>"illegal_argument_exception",
"reason"=>"Invalid format: \"2017/03/09 07:19:17\" is malformed at \"/03/09 07:19:17\""
}
}
When I insert 2017-03-09 07:19:17
, It will be successfully inserted as string.
Then I found that according to https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html#date-detection, the default date format for Dynamic field mapping
is "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
.
However, according to https://www.elastic.co/guide/en/elasticsearch/reference/5.2/date.html#date, the default date format for parse looks like "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd"
.
So that It seems my data 2017/03/09 07:19:17
is recognized as date
but can not parse by the default config.
I wonder if it is a bug of elasticsearch, or I misunderstanding the documentation?
Thanks!