Exclude Directorys in Filebeat

I need harvest all log files in an directory and the subdirectories and exclude the backup directories that are in the same location.
e. g.
/foo/bar/service1/.log
/foo/bar/service1.backup/
.log
/foo/bar/service2/.log
/foo/bar/service2.backup/
.log

is there a possibility to exclude all the directories with the ending .backup and their subdirectories from harvesting.

I think you may find an answer in this thread: How to exclude a sub directory and all of it's files

I tried this as

 exclude_files:
    - '^/foo/bar/*.backup/'

without any success

I'm afraid this is not a valid regular expression. Please try to use sth like this:

 '^\/foo\/bar\/.+(.backup)\/.+'

also - you can use this page to figure out a proper regular expression: https://regex101.com/

Thank you, that worked. And the link will come in handy.

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