I have the following file structure:
my-file1.2019-07-16.log
my-file2.2019-07-16.log
my-file.log
Is there a way to apply a RegEx in the exclude_files so that any of the files that have the YYYY-MM-DD pattern are excluded?
I have the following file structure:
my-file1.2019-07-16.log
my-file2.2019-07-16.log
my-file.log
Is there a way to apply a RegEx in the exclude_files so that any of the files that have the YYYY-MM-DD pattern are excluded?
Hi @bgeveritt and welcome to discuss 
Yes, it should be possible to use the exclude_files option to exclude files based on a pattern. If this is not working for you, please share your configuration so we can see what can be happening.
If these are older files, other thing you can try is to use the ignore_older option, that allows to ignore old files.
Looks like I sorted it out with the following config:
exclude_files: ['[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]).log']
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.