# How to pass date range in url template

**URL:** <https://discuss.elastic.co/t/how-to-pass-date-range-in-url-template/233245>\
**Category:** Kibana\
**Created:** [May 19, 2020, 4:47am UTC](https://discuss.elastic.co/t/how-to-pass-date-range-in-url-template/233245 "2020-05-19T04:47:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nurkan\_Dzhsupov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nurkan_dzhsupov/32/47189_2.png) [@Nurkan\_Dzhsupov](https://discuss.elastic.co/u/Nurkan_Dzhsupov)\
**Post date:** [May 19, 2020, 4:47am UTC](https://discuss.elastic.co/t/how-to-pass-date-range-in-url-template/233245/1 "2020-05-19T04:47:58Z")

</div>

For example I woluld like set date range in `http://localhost:5601/app/kibana#/management/kibana/index_patterns/ff959d40-b880-11e8-a6d9-e546fe2bba5f/field/category?_g=(refreshInterval:(pause:!f,value:900000),time:( **from:{{value}}, to:{{value}}** ))`

---

<div class="post-metadata">

**Author:** ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)\
**Post date:** [June 4, 2020, 9:12pm UTC](https://discuss.elastic.co/t/how-to-pass-date-range-in-url-template/233245/2 "2020-06-04T21:12:44Z")

</div>

@Nurkan_Dzhsupov welcome to the community!  
what you want is a [range query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html) where the field the range operates on is a [date field](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html) datatype. Here's an example snippet from a query in Discover (using the `kibana_sample_data_ecommerce` dataset)

```auto
_g=(refreshInterval:(pause:!f,value:900000),time:(from:now-7d,to:now-6d))...

```

"now-7d" uses [date math](https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math)

---

<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 2, 2020, 9:12pm UTC](https://discuss.elastic.co/t/how-to-pass-date-range-in-url-template/233245/3 "2020-07-02T21:12:44Z")

</div>

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