5
responses
responses
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>
Comments (4)
That breaks the Input, stating that `File` is already defined.
Hi, what if you added two input sections (one for each extension type) and then included both into the route block as source (Path in1, in2 => out )? Thanks
Thanks @konstantinos,
I had this vague idea that since NXlog language has wide support for regex scripting, that it may be possible to achieve this in one line; those dual Inputs was what I aimed to avoid ;) but in the end, that is what I ended up with.
No problem! Actually what Manuel suggested above with multiple File directives has been implemented in the NXLog Enterprise Edition