Utc offset with timezone

Hello everyone.

I have a timezone field in my data schema.

Example: timezone: "Los Angles"

Is it possible to create a scripted field and get the UTC offset from it?

Thanks in advance for your future responses.

By UTC offset you mean the difference of hours/minutes etc between your timezone and UTC? Unfortunately I don't think it's possible. You would have to make the changes in how you ingest your data (either ingesting utc_time too, for example kibana_sample_data_logs does that) or ingest directly a numeric timezone field.

If there is a way, you may use java.time.zone. There are some function to get offset from ZoneId.

"Using Datetime in Painless" would help you.

In addition, I wonder the timezone ID could be "America/Los_Angeles" and I'm not sure you have to convert from "Los Angeles".

1 Like

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