-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggs: use time_zone
in date_histogram
to format bucket keys
#9710
Comments
+1 |
I'm working on a solution with minimal code changes that would only require a setter for the time zone in the DateTime formatter and a small change in the DateHistogramParser. I ran some local tests, a query like
would now get results like:
The nice thing is that Without specifying the
Note that this doesn't affect custom formatting like:
Also, the time zone can entirely be dropped with custom formatting so it looks like local time, but the key is still UTC:
|
I wonder if this needs to be configurable because it is a nice default behaviour and one can always specify a format that drops the time zone using custom formatting. I will open a PR with my current changes for discussion. |
@cbuescher The behaviour described above looks great to me. Also +1 to not introduce additional settings. |
…ng to `time_zone` Change bucket key_as_string to reflect `time_zone` parameter. Currently `time_zone` shifts bucket boundaries to other time zone, but keys are displayed in UTC, so e.g. daily buckets in "+01:00" time zone have key_as_string like "2014-01-01T23:00:00Z". With this change the default is to format this dates according to the local time zone, so the above bucket key would be "2014-01-02T00:00:00+01:00". Closes elastic#9710
time_zone
in date_hisogram
to format bucket keys time_zone
in date_histogram
to format bucket keys
Follow up issue to the
date_histogram
clean up in #9062. Since we have only onetime_zone
option now, we could use this to print the keys of buckets in adate_histogram
that uses other time zone than UTC to the specified time zone.More details about how this could look like here: #9062 (comment)
The text was updated successfully, but these errors were encountered: