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

Absolute search results in widget using wrong time #2428

Closed
edmundoa opened this Issue Jun 28, 2016 · 0 comments

Comments

Projects
None yet
3 participants
@edmundoa
Member

edmundoa commented Jun 28, 2016

Problem description

From the mailing list:

Ive got a (little) dashboard problem, that drives me crazy. I want the histogram showing the message flow of a day.
I do a general search for all messages of a certain day using the time picker from 2016-06-15 00:00:00 to 2016-06-16 00:00:00.
My timezone is Europe/Berlin, so plus 2 hours at the moment. In the browser URL I can see "from=2016-06-14T22%3A00...."

The histogram shows 24 bars from 00 to 23, everything is fine until I add the histogram to a dashboard.
Now the histogram has that particular time range from 2016-05-14 22:00:00:00 to 2016-06-15 22:00:00:

What am I doing wrong, that this -2 hours shift happens?

I could reproduce the issue in the current master.

Steps to reproduce the problem

  1. Set Europe/Berlin as your Graylog, browser, and user time zone
  2. Do an absolute search (the range shouldn't really matter, but it's easier to see if you pick midnight). I tried with 2016-06-27 00:00:00 to 2016-06-28 00:00:00
  3. Verify that the histogram x-axis shows the time range selected (from 00:00 to 00:00 in your time zone). Also see that the URL params are from=2016-06-26T22%3A00%3A00.000Z&to=2016-06-27T22%3A00%3A00.000Z
  4. Add the search histogram to a dashboard
  5. Verify that the search result histogram widget x-axis displays the wrong time
  6. Open the widget information and see that it is using { "from": "2016-06-26T20:00:00.000+0000", "to": "2016-06-27T20:00:00.000+0000", "type": "absolute" } as time range

Environment

  • Graylog Version: 2.0.3 / 2.1.0-SNAPSHOT (21c0bcf)
  • Browser version: Chrome 53

@edmundoa edmundoa added bug web labels Jun 28, 2016

@edmundoa edmundoa added this to the 2.0.4 milestone Jun 28, 2016

@jalogisch jalogisch modified the milestones: 2.1.0, 2.0.4 Jul 4, 2016

@jalogisch jalogisch added S3 P2 labels Jul 4, 2016

@edmundoa edmundoa self-assigned this Jul 4, 2016

edmundoa added a commit that referenced this issue Jul 4, 2016

Keep time zone information when creating widget
Absolute time ranges in widgets were getting converted into
ES_DATE_FORMAT, which converts the time into UTC, but loses the time
zone information from the string representation. As the AbsoluteRange
create method parses the date time and tries to keep the time zone
information, that resulted in UTC times being converted into local time.

To fix the problem we avoid using ES_DATE_FORMAT, and use ISO8601
instead.

Fixes #2428

@joschi joschi closed this in #2452 Jul 5, 2016

joschi added a commit that referenced this issue Jul 5, 2016

Keep time zone information when creating widget (#2452)
Absolute time ranges in widgets were getting converted into
ES_DATE_FORMAT, which converts the time into UTC, but loses the time
zone information from the string representation. As the AbsoluteRange
create method parses the date time and tries to keep the time zone
information, that resulted in UTC times being converted into local time.

To fix the problem we avoid using ES_DATE_FORMAT, and use ISO8601
instead.

Fixes #2428

@kroepke kroepke added triaged and removed triaged labels Sep 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment