NxLog process logs from multiple directories

Tags:

#1 Deleted user

I have a directory with multiple sub directories where I need to get logs from.

Under my original plan for getting all files types in a single directory, I can get it to work by appending "\*.log" for instance at the end of the path, but unfortunately it gets every log file and not just the ones I am looking for.

Is there a way to have NxLog Community Edition search through sub directories to find the files?

This is my lab setup:

C:\users\admin\Desktop\testfiles\Server1\w3c1\test.log \w3c2\test.log \Server2\w3c1\test.log \w3c2\test.log

I've tried using these, but they don't work "C:\users\admin\Desktop\testfiles\\w3c\*.log" "C:\users\admin\Desktop\testfiles\*\w3c*\*.log"

We need it like something close to this because Server1 also has other logs that we don't want like firewall.log files.

Any advice would be great.

Thanks

#2 Zhengshi Nxlog ✓
#1 Deleted user
I have a directory with multiple sub directories where I need to get logs from. Under my original plan for getting all files types in a single directory, I can get it to work by appending "\*.log" for instance at the end of the path, but unfortunately it gets every log file and not just the ones I am looking for. Is there a way to have NxLog Community Edition search through sub directories to find the files? This is my lab setup: C:\users\admin\Desktop\testfiles\Server1\w3c1\test.log \w3c2\test.log \Server2\w3c1\test.log \w3c2\test.log I've tried using these, but they don't work "C:\users\admin\Desktop\testfiles\\w3c\*.log" "C:\users\admin\Desktop\testfiles\*\w3c*\*.log" We need it like something close to this because Server1 also has other logs that we don't want like firewall.log files. Any advice would be great. Thanks

The way you are trying currently is not supported as directory wildcards are not supported.
If all of the files you are looking for are called test.log then you could use the Recursive directive as it was meant as a directory wildcard replacement, of sorts.

File  C:\users\admin\Desktop\testfiles\test.log
Recursive  True

This should match test.log in any subdirectory. NXLog EE also has an Exclude directive that could prove to be useful as well being able to use multiple File directives.