# Logstash Input Filter By Date

**URL:** <https://discuss.elastic.co/t/logstash-input-filter-by-date/105779>\
**Category:** Logstash\
**Created:** [October 30, 2017, 4:21pm UTC](https://discuss.elastic.co/t/logstash-input-filter-by-date/105779 "2017-10-30T16:21:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maddie0726](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@maddie0726](https://discuss.elastic.co/u/maddie0726)\
**Post date:** [October 30, 2017, 4:21pm UTC](https://discuss.elastic.co/t/logstash-input-filter-by-date/105779/1 "2017-10-30T16:21:40Z")

</div>

I have Elasticsearch Kibana and Logstash version 5.6.2 all running on WIndows 2012 R2. I am reading input from a .txt file. I have one .txt file for the current day that is always updating with new, live events and an archived file for every day up to 90 days old. I need logstash to only read input from the current day and ignore the other 89 days worth of .txt files. I might be over thinking this but how can I do that? Right now I have to change the config file every morning to the current date and as I am trying to automate everything, this is counterproductive. I need a way to keep my config file the same and only read in the current day's .txt file.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![maddie0726](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@maddie0726](https://discuss.elastic.co/u/maddie0726)\
**Post date:** [October 30, 2017, 4:36pm UTC](https://discuss.elastic.co/t/logstash-input-filter-by-date/105779/2 "2017-10-30T16:36:09Z")

</div>

If I use the \* wldcard to read all .txt files and use ignore\_older =\> 86400 (24 hours in seconds), will that work?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 30, 2017, 8:22pm UTC](https://discuss.elastic.co/t/logstash-input-filter-by-date/105779/3 "2017-10-30T20:22:44Z")

</div>

Should work.

---

<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:** [November 27, 2017, 8:22pm UTC](https://discuss.elastic.co/t/logstash-input-filter-by-date/105779/4 "2017-11-27T20:22:48Z")

</div>

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