That did the job!

Initially I was getting an error in logs:
"status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [Date Timestamp] of type [date] in document with id 'J-5y1XcB8LyTQ8P8kixS'. Preview of field's value: '2021-02-18T16:43:07.000Z'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"failed to parse date field [2021-02-18T16:43:07.000Z] with format [MMM dd HH:mm:ss]", "caused_by"=>{"type"=>"date_time_parse_exception", "reason"=>"Text '2021-02-18T16:43:07.000Z' could not be parsed at index 0"}
In the above log you can see Logstash is passing date with format '2021-02-18T16:43:07.000Z'
. The error came due to the format
defined in the mapping template within Elasticsearch. Upon remove that format
and try again, the error was gone. Now I have the following values for the time fields:
@timestamp Feb 24, 2021 @ 14:20:11.162
Date Timestamp Feb 18, @ 11:43:07.000
Even so, Elasticsearch indexed all entries in Feb, 2021 as expected!
Questions:
- Even when the entry it's being indexed with the right year, why field
Date Timestamp
is not showing the year?
- The main goal is to have events indexed properly but, is there a way to physically include/show the year in field
Date Timestamp
?