How to configure filebeat to grab today's file from a directory where many files have a name like access.log-yyyy.mm.dd


(Metricbeat) #1

Hello,

I have a directory with many files with name as in this format: access.log-yyyy.mm.dd Example:

1278720 Jun 9 23:59 access.log-2018.06.09
1337590 Jun 10 23:59 access.log-2018.06.10
12797116 Jun 11 23:59 access.log-2018.06.11
84921728 Jun 12 23:59 access.log-2018.06.12

There are many of these files from previous months. I'm interested on configuring filebeat to every day pay attention only to current file. Example, today is 6/19/2018 and I would like filebeat paying attention only to file access.log-2018.06.19 and ignoring the rest.

Is that possible?

I do not want to remove older files so that filebeat starts from clean today. Neither I want filebeat to parse old files as I'm not interested in processing older logs.

Please advise
Thanks


(Christian Dahlqvist) #2

You can use the ignore_older configuration parameter to ignore older files.


(Metricbeat) #3

Many thanks @Christian_Dahlqvist for the advise!!


(system) #4

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