Skip to content

date_histogram interval uses xM as xm #14802

@pickypg

Description

@pickypg

The date_histogram interval is parsing "3M" as though it were minutes (e.g., "3m"). This leads to aggregations that should be invalid being accepted that create a massive number of buckets given the wrong data set.

An example aggregation that has a painfully large response (5 months created a ~700K lines of pretty printed JSON with only 4 documents in the index):

{
  "aggregations": {
    "byMonth": {
      "date_histogram": {
        "field": "begintime",
        "interval": "3M"
      },
      "aggregations": {
        "attrs": {
          "terms": {
            "field": "primaryattribution"
          },
          "aggregations": {
            "avg_by_attrs": {
              "avg": {
                "field": "pageviews"
              }
            }
          }
        }
      }
    }
  }
}

As an important note, "1M" appropriately gets interpreted as "month".

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