Converting a string date (epoch) to a Date field using scripted fields in kibana

Hi!

I have a date in the form of a string (epoch) like below:

"1553012442470"

Now I want to use scripted fields in kibana to convert the string date time to a date field.

Also perform multiple operations with the field on the date, for example, subtract these two dates and choose the days of difference

How can I go about it?

1 Like

Is there any reason you wouldn't want to do this at ingest time instead of after the fact with a scripted field?

Lukas,
When indexing the data we indicate the date Epoch is the _id
I can not reindex the data and change the mapping

return new Date(Long.parseLong(doc["_id.keyword"].value));

Thanks Lukas! :sonriendo:

Thanks Lukas! :sonriendo:

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