# Auto\_date\_histogram and extended\_bounds

**URL:** <https://discuss.elastic.co/t/auto-date-histogram-and-extended-bounds/296733>\
**Category:** Elasticsearch\
**Created:** [February 9, 2022, 2:14pm UTC](https://discuss.elastic.co/t/auto-date-histogram-and-extended-bounds/296733 "2022-02-09T14:14:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew22](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@Andrew22](https://discuss.elastic.co/u/Andrew22)\
**Post date:** [February 9, 2022, 2:14pm UTC](https://discuss.elastic.co/t/auto-date-histogram-and-extended-bounds/296733/1 "2022-02-09T14:14:58Z")

</div>

Hello,

I am trying to make a query using auto\_date\_histogram and extended\_bounds but i get the error:  
` [auto_date_histogram] unknown field [extended_bounds]`

the documentation for auto\_date\_histogram does mention extended\_bounds in the note but I can't figure it out. here is the documentation I am looking at where it mentions extended\_bounds:

> **[Auto Date Histogram Aggregation Usage | Elasticsearch .NET Clients \[7.16\] |...](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/auto-date-histogram-aggregation-usage.html)**

here is my query:

```auto
GET poller-*/_search
{
  "aggs": {
          "time_buckets": {
            "auto_date_histogram": { 
              "field": "timestamp",
              "buckets": 100,
              "minimum_interval": "minute",
              "format": "epoch_millis",
              "extended_bounds": {
               "min": 0,
                "max": 500
              }
            },
            "aggs": {
              "ifhcin_avg": {
                "avg": {
                  "field": "ifhcin_avg"
                }
              },
                "ifhcin_max": {
                "max": {
                  "field": "ifhcin_max"
                }
              },
              "ifhcout_avg": {
                "avg": {
                  "field": "ifhcout_avg"
                }
              },
                "ifhcout_max": {
                "max": {
                  "field": "ifhcout_max"
                }
              },
                "bw_in": {
                "max": {
                  "field": "bw_in_util_pct"
                }
              },
                "bw_out": {
                "max": {
                  "field": "bw_out_util_pct"
                }
              },
                "ifSpeed": {
                "max": {
                  "field": "ifSpeed"
                }
              },
              "percentage": {
                "bucket_script": {
                  "buckets_path": {
                    "in": "bw_in",
                    "out": "bw_out"
                  },
                  "script": "if (params.in > 0.50) { return (1) } else if (params.out > 0.50) { return (1) } else { if (params.in > params.out) { return (params.in) } else if (params.out > params.in) { return (params.out) } }"
                }
              },
              "none": {
                "bucket_script": {
                  "buckets_path": {
                    "in": "bw_in",
                    "out": "bw_out",
                    "speed": "ifSpeed"
                  },
                  "script": "if (params.in > 0.50) { return (params.speed) } else if (params.out > 0.50) { return (params.speed) } else { return null }"
                }
              },
              "largest": {
                "bucket_script": {
                  "buckets_path": {
                    "in": "ifhcin_max",
                    "out": "ifhcout_max"
                  },
                  "script": "if (params.in < params.out) { return params.in } else if (params.out < params.in) { return params.out } else { return params.in }"
                }
              }
            }
          }
        },
        "size": 20
}

```

---

<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:** [March 9, 2022, 2:15pm UTC](https://discuss.elastic.co/t/auto-date-histogram-and-extended-bounds/296733/2 "2022-03-09T14:15:53Z")

</div>

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