# Passing dynamic values to range query

**URL:** <https://discuss.elastic.co/t/passing-dynamic-values-to-range-query/329037>\
**Category:** Elasticsearch\
**Created:** [March 31, 2023, 9:48am UTC](https://discuss.elastic.co/t/passing-dynamic-values-to-range-query/329037 "2023-03-31T09:48:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farah\_Bhr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/farah_bhr/32/82537_2.png) [@Farah\_Bhr](https://discuss.elastic.co/u/Farah_Bhr)\
**Post date:** [March 31, 2023, 9:48am UTC](https://discuss.elastic.co/t/passing-dynamic-values-to-range-query/329037/1 "2023-03-31T09:48:24Z")

</div>

In kibana discover, with Elasticsearch Query DSL, I want to search for a range of timestamp dynamically  
here is the range I used:

```auto
{
          "range": {
            "@timestamp": {
              "gte": "2023-03-03T15:00:00.000Z",
              "lt": "2023-03-03T17:00:00.000Z"
            }
          }
        }

```

but I want to change the value of gte and lte to a dynamic value taking the value of two fields I already defined , for example gte takes the field's value "start\_time" and lte takes the field's value "end\_time"

Is there a way to do so?  
Any help please

---

<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:** [April 28, 2023, 9:48am UTC](https://discuss.elastic.co/t/passing-dynamic-values-to-range-query/329037/2 "2023-04-28T09:48:41Z")

</div>

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