Multiple date formats to single date format

I have multiple date format in kibana say Y-M-D , M-D-Y, D-M-Y and Y/M/D
I want to change them to single format say Y-M-D

Please help me with the painless script
Index name is Case
Field name is Decision_date

Hi, I'm not sure how to do this in Painless, but the documentation on Elasticsearch date format might help: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html

In JSON documents, dates are represented as strings. Elasticsearch uses a set of preconfigured formats to recognize and parse these strings into a long value representing milliseconds-since-the-epoch in UTC.

So if the field is correctly mapped as date format, then the Painless script should be able to use the raw value of milliseconds since the epoch. You shouldn't have to worry about the format of the string in the _source

I dont think I get what you said. What should I do again ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.