Painless script in Kibana to convert timestamp array in Date format

Hi, I have an array of of Epoch time in timestamp field. I want to use painless script to convert this array field in Date field which can be used by Kibana.

Following is my painless script

LocalDateTime date;
for (int i = 0; i < doc['timestamp'].length; ++i) {
date = LocalDateTime.ofInstant(Instant.ofEpochMilli(doc['timestamp'][i].value), ZoneId.of('Z')).getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.getDefault())

My Timestamp field looks like this
"timestamp": [

What is the mapping for the field? Why don't you store them as Dates in Elasticsearch?

I have all the dates in an array and Date filter will not convert an array into Date.

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