# How to get kibana time range filter value on a Scripted metric aggregation

**URL:** <https://discuss.elastic.co/t/how-to-get-kibana-time-range-filter-value-on-a-scripted-metric-aggregation/277330>\
**Category:** Elasticsearch\
**Created:** [June 29, 2021, 9:52am UTC](https://discuss.elastic.co/t/how-to-get-kibana-time-range-filter-value-on-a-scripted-metric-aggregation/277330 "2021-06-29T09:52:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayanam](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@ayanam](https://discuss.elastic.co/u/ayanam)\
**Post date:** [June 29, 2021, 9:52am UTC](https://discuss.elastic.co/t/how-to-get-kibana-time-range-filter-value-on-a-scripted-metric-aggregation/277330/1 "2021-06-29T09:52:18Z")

</div>

Hi, I'm trying to retrieve the min and max of the time range set on kibana in a scripted metric aggregation (in the reduce\_script part), if anyone has an idea on how to achieve this.

---

<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:** [July 27, 2021, 9:52am UTC](https://discuss.elastic.co/t/how-to-get-kibana-time-range-filter-value-on-a-scripted-metric-aggregation/277330/2 "2021-07-27T09:52:40Z")

</div>

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