I have the mapping defined for "timestamp" field on ES as follows: "timestamp": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss Z" }
and I'm trying to index the following document, { "account":"170/170/78202", "timestamp":"2019-10-06T10:52:09-04:00" }
But getting exception as "failed to parse date field [2019-10-06T10:52:09-04:00] with format [yyyy-MM-dd HH:mm:ss Z]". In ES version 6.7, it worked well, but in 7.3.2, it doesn't work. Do we need to change in the way we index the date type values or need to adjust the mapping we defined in the index?
This does not work under 6.8 either, as you time format does not match the date.
The format does not mention a T but a whitespace between date and time and also there is no whitespace between the time and the timezone, which is expected in the mapping format.
The problem was with the colon( : ) in the timezone value. I've removed that and it worked. '{"account":"170/170/78202","timestamp":"2019-10-06 10:52:09 -0400"}'
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.