How to show date in UTC format in the downloaded CSV file from kibana


(Bhavana) #1

Hello Everyone,

when i download the CSV file from the kibana visualization , i am getting date in UNIX format rather than UTC. Is there any possibility to get that date field in UTC format itself ?

Thanks ,
Bhavana.


(Marius Dragomir) #2

If you're exporting DataTable data you could use this scripted field as one of the columns so that you can get the date in a formated string:
def sdf = new SimpleDateFormat('YYYY/MM/dd HH:mm:ss z');sdf.setTimeZone(TimeZone.getTimeZone("UTC"));sdf.format(new Date(doc['@timestamp'].value))
This script will convert the value of the @timestamp field to a string formatted to UTC timezone like this 2017/05/15 11:16:20 AM UTC
Keep in mind that this will be a resource intensive script if you have lots of docs in your vis.


(Bhavana) #3

Thanks for the reply ,

I didn't look at the formatted data download in kibana , it is showing me date in the UTC format rather than the UNIX format which is shown in Raw download in kibana.

I tried the scripted field too, as it is mentioned resource intensive which is so slow for retrieving results.


(system) #4

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