-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Date Histogram Aggregations w/ extended_bounds
and time_zone
#12278
Comments
@cbuescher could you take a look at this one? I think the docs need some updating - I'm confused as to best way to do something like this. thanks |
I just verified this on 1.7. and the result still looks like @feltnerm describes it above. Might be a bug, but looking at the code, at first glance it looks like timezone should already be applied to |
@feltnerm which version of ES were you using for the output you described above? |
@cbuescher the above is from 1.5.2, but I have tried with 1.6.x as well. Can try on 1.6.x or 1.7.x if needed. |
Some preliminary findings: I was able to dig a bit deeper into this, and could reproduce the behaviour on master, haven't found a way to fix this though. |
This PR adds a timezone field to ValueParser.DateMath that is set to UTC by default but can be set using the existing constructors. This makes it possible for extended bounds setting in DateHistogram to also use date math expressions that e.g. round by day and apply this rounding in the time zone specified in the date histogram aggregation request. Closes elastic#12278
This PR adds a timezone field to ValueParser.DateMath that is set to UTC by default but can be set using the existing constructors. This makes it possible for extended bounds setting in DateHistogram to also use date math expressions that e.g. round by day and apply this rounding in the time zone specified in the date histogram aggregation request. Closes #12278
Hey all,
I'm performing a date histogram aggregation over the past day (
'now/d'
->'now/d'
), and would like to get results into hourly buckets. I am using theextended_bounds
of the aggregation because I would still like to get empty buckets back (as long as they are within my time range).Everything is working almost as expected... except it seems like
extended_bounds
is not respecting the time zone.My query returns the UTC "midnight" bucket which becomes 7pm (on the previous day) when I adjust for my timezone (CST). I would expect that
extended_bounds
withtime_zone
would return that timezone's midnight.So if I were performing a query from
'now/d'
to'now/d'
in CST (which is GMT-5 currently), I would expect the first bucket to be'2015-07-15T05:00:00.000Z'
and not'2015-07-15T00:00:00.000Z'
.My question is: Is
extended_bounds
not respectingtime_zone
?I'm having trouble succinctly describing this in English; hopefully my test case below helps to explain:
Test Case:
Index a new document with timestamp of 00:00 GMT:
Index a new document with timestamp of 08:00 GMT:
Search!
Result:
As you can see, we are getting the expected hits ("James Madison"), and the document is in the correct bucket. I would prefer the first bucket to start at the beginning of the day in the timezone I specified in the query ("-05:00"), and not at the beginning of the day in UTC.
Thanks for your review, and thanks your hard work!
The text was updated successfully, but these errors were encountered: