How to exclude a sub directory and all of it's files

Hello,

I am trying to exclude a sub directory and all of its files in file beat . In the documentation, i know that there is a flag called "exclude_files". But having hard time to figure out how to use it to exclude a sub directory.

For example,

This log path contains /var/log/syslog/port below sub directories

10.1.123.145
qpn001data1
qpn002data1
old
vqpn0001patha1
vqpn0002patha1
vqpn0003patha1

But i want to eliminate the sub directory "old" all the files in it .. Is it possible to do it with "exclude_files ?

Thanks

@iamlearner123 You should be able to use exclude_files with a regular expression that match the directory that you want to exclude.

I think the following should work in your case.

 exclude_files:
    - '^/var/log/syslog/port/'

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