# Dynamic date log file input to Filebeat

**URL:** https://discuss.elastic.co/t/dynamic-date-log-file-input-to-filebeat/188124
**Category:** Beats
**Tags:** filebeat
**Created:** [June 29, 2019, 5:41am UTC](https://discuss.elastic.co/t/dynamic-date-log-file-input-to-filebeat/188124 "2019-06-29T05:41:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Dibyakanta](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@Dibyakanta](https://discuss.elastic.co/u/Dibyakanta)
#### Post date: [June 29, 2019, 5:41am UTC](https://discuss.elastic.co/t/dynamic-date-log-file-input-to-filebeat/188124/1 "2019-06-29T05:41:23Z")

</div>

Hi,

I have a requirement to add log files to my filebeat server which will create an index in Elasticsearch.  
The location from where Filebeat would be taking the log file contains log file of different dates. Suppose for today's date, the log file generated by Tomcat is user\_log-2019.06.29 and for tomorrow a new log file with name log-2019.06.30 will be generated. So how shall I configure the path in filebeat.yml so that it will take that particular date's log file. My filebeat server will be running for the whole month. My yml file looks like below:

filebeat.prospectors:

- type: log  
paths:
  - D:/MyFolder/filebeat-6.1.0-windows-x86\_64/filebeat-6.1.0-windows-x86\_64/user\_log-2019.06.29.log  
This is the yml file for one day's log.

I tried with

paths:  
- D:/MyFolder/filebeat-6.1.0-windows-x86\_64/filebeat-6.1.0-windows-x86\_64/user\_log-%{+YYYY.MM.dd}.log

But it didn't work. Can you please help me with this.

Thank You.

---

<div class="post-metadata">

### Author: ![martinr\_ubi](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@martinr\_ubi](https://discuss.elastic.co/u/martinr_ubi)
#### Post date: [June 29, 2019, 7:04pm UTC](https://discuss.elastic.co/t/dynamic-date-log-file-input-to-filebeat/188124/2 "2019-06-29T19:04:01Z")

</div>

you can’t use that in a glob pattern for the path setting. use a \* as a wildcard character for the part of the filename that varies between files.

To ignore older files use the ignore\_older setting as mentioned in your other post.

---

<div class="post-metadata">

### Author: ![Dibyakanta](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@Dibyakanta](https://discuss.elastic.co/u/Dibyakanta)
#### Post date: [July 1, 2019, 5:49am UTC](https://discuss.elastic.co/t/dynamic-date-log-file-input-to-filebeat/188124/3 "2019-07-01T05:49:22Z")

</div>

Thank you for your help.

---

<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 29, 2019, 5:49am UTC](https://discuss.elastic.co/t/dynamic-date-log-file-input-to-filebeat/188124/4 "2019-07-29T05:49:28Z")

</div>

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