# How to parse today's file

**URL:** <https://discuss.elastic.co/t/how-to-parse-todays-file/25968>\
**Category:** Logstash\
**Created:** [July 21, 2015, 9:37am UTC](https://discuss.elastic.co/t/how-to-parse-todays-file/25968 "2015-07-21T09:37:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [July 21, 2015, 9:37am UTC](https://discuss.elastic.co/t/how-to-parse-todays-file/25968/1 "2015-07-21T09:37:46Z")

</div>

Hi Experts,

I want parse today's log file . I tried the following (kind of stupid thing I have done as it works only for output )but no luck .Please suggest how I can achieve this .

input {  
file {  
path =\> "E:\CEF\SIEM-%{+YYYY-MM-dd}.txt"  
start\_position =\> "beginning"  
}  
}

---

<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:** [July 21, 2015, 9:49am UTC](https://discuss.elastic.co/t/how-to-parse-todays-file/25968/2 "2015-07-21T09:49:38Z")

</div>

See the recent thread below. I don't think `%{+YYYY-MM-dd}` works in this context since it uses the current event's timestamp, but inputs don't have a current event context.

> [@Dynamic input file name](https://discuss.elastic.co/t/dynamic-input-file-name/25951):
>
> Hi, I have log file whose name changes as per date. How to set path in the input filter. i have given below path: "/www/redhat/ews-abc-uat/tomcat7/logs/access.date '+%F'.log" Its not working. Please suggest. Regards, Raman

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [July 21, 2015, 9:59am UTC](https://discuss.elastic.co/t/how-to-parse-todays-file/25968/3 "2015-07-21T09:59:02Z")

</div>

so does that means if I have 30 files in my folder (I mean one for each day), Logstash will read all those again because we will be using \* .I understand sincedb will store a pointer but that would be very hectic for LS ?

---

<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:** [July 21, 2015, 10:06am UTC](https://discuss.elastic.co/t/how-to-parse-todays-file/25968/4 "2015-07-21T10:06:20Z")

</div>

> so does that means if I have 30 files in my folder (I mean one for each day), Logstash will read all those again because we will be using \*.

With `start_position => "beginning" ` the files will be read again if they are new to Logstash.

> I understand sincedb will store a pointer but that would be very hectic for LS ?

Logstash will stat all files matched by the configured pattern every [`stat_interval`](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html#plugins-inputs-file-stat_interval) seconds. For 30 files that shouldn't be a problem, and as long as the files aren't updated the sincedb file won't be affected.

---

<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, 5:34am UTC](https://discuss.elastic.co/t/how-to-parse-todays-file/25968/5 "2017-07-06T05:34:08Z")

</div>


