Skip to content

Range filters, date math and time_zone #9814

@mewwts

Description

@mewwts

Hi guys.

I've stumbled upon an issue. When specifying the time_zone parameters in a range filter where gte and lt are set using datemath, the time zone is not taken into account when rounding!

The following is part of a filters aggregation, and I expect to be given the week 4 weeks ago, starting on a
sunday at 23:00 UTC time, and ending on sunday 23:00 UTC time with a full week in between.

{
  "filters": {
    "4w": {
      "range": {
        "timestamp": {
          "lt": "now-4w+1w/w",
          "gte": "now-4w/w",
          "time_zone": "+01:00"
        }
      }
    }
  }
}

But no, after inspecting the docs that are returned, there are no documents returned between the first sunday 23:00 and monday 00:00 UTC. There are however documents returned between sunday 23:00 and monday 00:00 UTC at the end of the interval.

Is this a bug? Should not timezones be included when doing rounding in date math?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions