How to fetch logs recursively, when the files may have a number of different file extensions?


#1 DS_534595
I traverse `/var/log/myAPPLICATION*` like shown below to harvest everything below in the folder structure, which has .log as extension. The challenge is now: What if there are occurences of logfiles that have e.g. .txt extension? Is it possible to use some conditional to that File line in the Input directive? Something like ` File "/var/log/myAPPLICATION/*.[log|txt]"` ``` Module im_file File "/var/log/myAPPLICATION/*.log" Recursive True SavePos True ReadFromLast True Exec to_syslog_ietf(); ```
#2 manuel.munozDeactivated Nxlog ✓
#1 DS_534595
I traverse /var/log/myAPPLICATION* like shown below to harvest everything below in the folder structure, which has .log as extension. The challenge is now: What if there are occurences of logfiles that have e.g. .txt extension? Is it possible to use some conditional to that File line in the Input directive? Something like File "/var/log/myAPPLICATION/*.[log|txt]" <Input appLogs> Module im_file File "/var/log/myAPPLICATION/*.log" Recursive True SavePos True ReadFromLast True Exec to_syslog_ietf(); </Input>

You could create several File lines:

<Input in>
    Module       im_file
    File         '/var/log/*.log'
    File         '/var/log/*.txt'