# Auto interval date histogram illegal argument exception, buckets must be less than 333

**URL:** <https://discuss.elastic.co/t/auto-interval-date-histogram-illegal-argument-exception-buckets-must-be-less-than-333/255042>\
**Category:** Elasticsearch\
**Created:** [November 11, 2020, 10:29am UTC](https://discuss.elastic.co/t/auto-interval-date-histogram-illegal-argument-exception-buckets-must-be-less-than-333/255042 "2020-11-11T10:29:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dyegoe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dyegoe/32/78812_2.png) [@dyegoe](https://discuss.elastic.co/u/dyegoe)\
**Post date:** [November 11, 2020, 10:29am UTC](https://discuss.elastic.co/t/auto-interval-date-histogram-illegal-argument-exception-buckets-must-be-less-than-333/255042/1 "2020-11-11T10:29:16Z")

</div>

I tried to create an `auto_date_histogram` to generate some graphs in our application and I would like to keep the length of this graph as 360 points (buckets).  
I'm trying to achieve at least for the last 6h a graph per minute, but if we increase the time range, I get buckets by hours, days, and so on.

However, when I try to use 360 buckets I get this error

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "buckets must be less than 333"
      },

```

There is a way to increase this limit?

---

<div class="post-metadata">

**Author:** ![Mohammad\_Mousavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_mousavi/32/56508_2.png) [@Mohammad\_Mousavi](https://discuss.elastic.co/u/Mohammad_Mousavi)\
**Post date:** [November 11, 2020, 10:55am UTC](https://discuss.elastic.co/t/auto-interval-date-histogram-illegal-argument-exception-buckets-must-be-less-than-333/255042/2 "2020-11-11T10:55:49Z")

</div>

Hello, I guess this might help you:  
Go to **Management** \> **Advanced Settings** , then find **Maximum buckets** and **Target buckets** and increase the maximum.  
One another probably solution is to increase **search.max\_buckets** with api:

> PUT \_cluster/settings  
> {  
> "transient": {  
> "search.max\_buckets": 10000  
> }  
> }

I'm not sure with them, I hope it can help you.

---

<div class="post-metadata">

**Author:** ![dyegoe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dyegoe/32/78812_2.png) [@dyegoe](https://discuss.elastic.co/u/dyegoe)\
**Post date:** [November 11, 2020, 11:14am UTC](https://discuss.elastic.co/t/auto-interval-date-histogram-illegal-argument-exception-buckets-must-be-less-than-333/255042/3 "2020-11-11T11:14:38Z")

</div>

Thanks for your help Mohammad, but it didn't work.  
I'm not confident that is related to `max_buckets`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 9, 2020, 11:14am UTC](https://discuss.elastic.co/t/auto-interval-date-histogram-illegal-argument-exception-buckets-must-be-less-than-333/255042/4 "2020-12-09T11:14:42Z")

</div>

Closed on December 9, 2020, 11:14am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
