# How do I apply Date Range filter?

**URL:** <https://discuss.elastic.co/t/how-do-i-apply-date-range-filter/62985>\
**Category:** Kibana\
**Created:** [October 13, 2016, 7:26pm UTC](https://discuss.elastic.co/t/how-do-i-apply-date-range-filter/62985 "2016-10-13T19:26:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![milincjoshi](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@milincjoshi](https://discuss.elastic.co/u/milincjoshi)\
**Post date:** [October 13, 2016, 7:26pm UTC](https://discuss.elastic.co/t/how-do-i-apply-date-range-filter/62985/1 "2016-10-13T19:26:10Z")

</div>

Hi  
I am using Kibana to filter out the date between specific date range. I have the data in following format.

{  
"\_index": "xyz",  
"\_type": "logs",  
"\_score": 1,  
"_source": {  
"log\_timestamp": "9/12/2016 7:59:06 AM",  
"@timestamp": "2016-09-12T14:59:06.000Z",  
"hour": "14",  
"date_": "9/12/2016",  
"weekday": "Mon",  
"just\_date": "2016-9-12",  
"date\_time": "2016-9-12",  
}

I want to filter out the logs between September 2015, 21 09:00 AM to September 2015, 23 10:00 PM.

How do I manipulate data format or fields so that I can apply Date Range filter provided in Kibana to filter out the logs between above given date time range.

Also do we require any additional Sub-bracket to be applied or just adding a Date Range filter will do the work?

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [October 13, 2016, 10:30pm UTC](https://discuss.elastic.co/t/how-do-i-apply-date-range-filter/62985/2 "2016-10-13T22:30:44Z")

</div>

The Date Range aggregation doesn't work that way. It's used to break your data apart by dates, not to "filter" the dates out of the dataset.

I believe you put JSON in the query bar to do what you need though. The data there would be queried like so:

```auto
"query": {
  "filtered": {
    "query": {
      <JSON HERE>
    }
  }
}

```

You can read more about the query syntax [in the Elasticsearch docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html).

You could probably also create a filter that you can edit to exclude that range, again, using the query syntax.

---

<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 6, 2017, 1:36pm UTC](https://discuss.elastic.co/t/how-do-i-apply-date-range-filter/62985/3 "2017-07-06T13:36:40Z")

</div>


