# When i am running this query without filter then it is running fine but when i am putting the filter context with time range of 10 minute i am not getting any value in hits. I have to filter and get the events of last 10 minutes

**URL:** <https://discuss.elastic.co/t/when-i-am-running-this-query-without-filter-then-it-is-running-fine-but-when-i-am-putting-the-filter-context-with-time-range-of-10-minute-i-am-not-getting-any-value-in-hits-i-have-to-filter-and-get-the-events-of-last-10-minutes/281679>\
**Category:** Elasticsearch\
**Created:** [August 17, 2021, 12:08pm UTC](https://discuss.elastic.co/t/when-i-am-running-this-query-without-filter-then-it-is-running-fine-but-when-i-am-putting-the-filter-context-with-time-range-of-10-minute-i-am-not-getting-any-value-in-hits-i-have-to-filter-and-get-the-events-of-last-10-minutes/281679 "2021-08-17T12:08:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashurajchandra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashurajchandra/32/92908_2.png) [@ashurajchandra](https://discuss.elastic.co/u/ashurajchandra)\
**Post date:** [August 17, 2021, 12:08pm UTC](https://discuss.elastic.co/t/when-i-am-running-this-query-without-filter-then-it-is-running-fine-but-when-i-am-putting-the-filter-context-with-time-range-of-10-minute-i-am-not-getting-any-value-in-hits-i-have-to-filter-and-get-the-events-of-last-10-minutes/281679/1 "2021-08-17T12:08:03Z")

</div>

```auto
{ 
    "sort": [{ "date": { "order": "desc" } }], 
    "from": 0, "size": 3, "track_total_hits": true,
     "query":
      {
           "bool":
            { 
                "must":
                 [
                     {
                          "bool":
                           {
                                "should":
                                 [
                                     {
                                         "match_phrase": {"actionType": "Diagnostic_Results"}
                                         }
                                         ]
                                          } 
                                          }, 
                                          {
                                               "match_phrase": { "saunaId": "p2b5889"} 
                                               }
                                               ],
                                                "filter": 
                                                  {
                                                       "range": 
{
 "@timestamp": { 
"gte": "now-10m",
 "lte": "now" 
}
}
                                                       }  
                                                       } 
                                                       } 
                                                       }

```

---

<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:** [September 14, 2021, 12:08pm UTC](https://discuss.elastic.co/t/when-i-am-running-this-query-without-filter-then-it-is-running-fine-but-when-i-am-putting-the-filter-context-with-time-range-of-10-minute-i-am-not-getting-any-value-in-hits-i-have-to-filter-and-get-the-events-of-last-10-minutes/281679/2 "2021-09-14T12:08:55Z")

</div>

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