Elastic Scripted Fields

Hi all,

I have a question regarding scripted fields.
I have the below vertical bar which shows the number of requests for each hour of the day. To get the hour of the day I have the following scripted field - (doc['startTime'].value).getHour().

I have Kibana's timezone settings set to default (gets them from the browser).

I am at a UTC+2 timezone and when I change my regional settings I to UTC-5 and run the dashboard I expect all of the records to be with a 7 hour difference, e.g. the highest bar which is at 14 o'clock, should be at 07, however I get the absolutey same result.

Does anybody know why this is happening?


Hi @lou_d,

Scripted fields are executed on the Elasticsearch server and do not have access to the time zone of the browser. Judging from the Elasticsearch docs, UTC is assumed unless something else is specified in the script itself.

I don't see a way how you could pass the current Kibana timezone to the script unfortunately. By specifying the timezone in a Kibana advanced setting for all users and using the same timezone in the script you should at least get consistent results, even though the timezone isn't configurable per use anymore.

Thanks @flash1293. I suspected that it had something to do with the execution time of the scripted field. Your suggestion sounds like the most reasonable approach.


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