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) {
return
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": [
"1516402800000",
"1516424400000",
"1516446000000",
]