Date histogram 6 months interval

I stand corrected that quarter and 1q are valid calendar intervals, but you can't do 2q or 6M because the calendar intervals can't be multiplied.

As a workaround, here are your options:

  • Use the Filters or Date Range aggregation to manually create the 6 month intervals. For example, date >= 2021-01-01 AND date < 2021-07-01
  • Create a runtime or scripted field using Painless scripting to manually determine which half of the year you're in, for example if the date is in July you could return 2H as your scripted date. See the docs here for examples: Using Datetime in Painless | Painless Scripting Language [7.13] | Elastic
1 Like