Skip to content

date_histogram fails for year buckets >1, like "10y" #8939

@jordansissel

Description

@jordansissel

Attempting to do a date_histogram with 10-year sized buckets, passing "10y" to the interval setting results in this error:

ElasticsearchParseException[Failed to parse [10y]]; nested: NumberFormatException[For input string: \"10y\"]; 

As a workaround, I can specify large values for "weeks", so swapping in 520w (or 3650d) might be inaccurate, but possibly acceptable to some folks.

Sample agg (taken from Kibana 4) that causes the NumberFormatException:

          "date_histogram": {
            "field": "@timestamp",
            "interval": "1y",
            "min_doc_count": 1,
            "extended_bounds": {
              "min": -1767196800000,
              "max": 1418425008298
            }
          }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions