Exclude Files with YYYY-MM-DD RegEx

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 :slight_smile:

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']

1 Like

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