# Lucene query for =\> current date

**URL:** <https://discuss.elastic.co/t/lucene-query-for-current-date/102466>\
**Category:** Kibana\
**Created:** [October 2, 2017, 6:29pm UTC](https://discuss.elastic.co/t/lucene-query-for-current-date/102466 "2017-10-02T18:29:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Callahan](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Callahan](https://discuss.elastic.co/u/Callahan)\
**Post date:** [October 2, 2017, 6:29pm UTC](https://discuss.elastic.co/t/lucene-query-for-current-date/102466/1 "2017-10-02T18:29:10Z")

</div>

Hi,

I'm looking for some info on whether I can query against an index field that contains a date. Essentially I have a "due-by" date in the format: "2017-10-04T18:25:57+01:00". I would like to know if it is possible to do a one line query looking for anything older than today's date within a given set of results. My end goal is a data table showing overdue jobs. I've not been able to find much in the way of examples online so I'm assuming I may have to address this differently.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [October 3, 2017, 1:45am UTC](https://discuss.elastic.co/t/lucene-query-for-current-date/102466/2 "2017-10-03T01:45:57Z")

</div>

Hi Callahan, when you create an index pattern (Management \> Index Patterns) you can specify your "due-by" field as the "time field filter name". This will allow you to use the time picker (found in the top-right corner of the screen inside of Visualize and Dashboard) to specify the time range in which you want to restrict your query. This time range could be a relative one similar to what you mention, e.g. "From 5 years ago until yesterday". By specifying this time range and then building a data table visualization in the Visualize app, I think you'll be able to accomplish your goal.

Hope this helps,  
CJ

---

<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:** [October 31, 2017, 1:46am UTC](https://discuss.elastic.co/t/lucene-query-for-current-date/102466/3 "2017-10-31T01:46:16Z")

</div>

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