Page 1 of 1

Multiple input files syntax

Posted: Thu Jan 11, 2018 9:24 am
by dlukinski
Hello LOG Support

How to configure multiple input files in this case?

<Input windowsfile>
Module im_file
File 'C:\Program Files (x86)\Skybot\Skybot Scheduler\logs' AND 'C:\Program Files (x86)\Skybot\Skybot Scheduler\pgsql\data\pg_log' = ?
SavePos TRUE
# ReadFromLast FALSE
Exec $Message = $raw_event;
</Input>

Re: Multiple input files syntax

Posted: Thu Jan 11, 2018 1:04 pm
by cdienger
You can use wildcards and the Recursisve(http://nxlog-ce.sourceforge.net/nxlog-d ... ml#im_file) directive to send multiple files using a single nxlog input config. It looks like the file directive only takes one argument though so if you cannot use wildcards to specify the filenames, you'd need to create an additional input in the nxlog config.

Re: Multiple input files syntax

Posted: Thu Jan 11, 2018 2:40 pm
by dlukinski
cdienger wrote:You can use wildcards and the Recursisve(http://nxlog-ce.sourceforge.net/nxlog-d ... ml#im_file) directive to send multiple files using a single nxlog input config. It looks like the file directive only takes one argument though so if you cannot use wildcards to specify the filenames, you'd need to create an additional input in the nxlog config.
so should i use 2 x Input blocks or 2 x File entries?


<Input windowsfile>
Module im_file
File 'C:\Program Files (x86)\Skybot\Skybot Scheduler\logs'
SavePos TRUE
# ReadFromLast FALSE
Exec $Message = $raw_event;
</Input>

+

<Input windowsfile>
Module im_file
File 'C:\Program Files (x86)\Skybot\Skybot Scheduler\pgsql\data\pg_log'
SavePos TRUE
# ReadFromLast FALSE
Exec $Message = $raw_event;
</Input>


OR


<Input windowsfile>
Module im_file
File 'C:\Program Files (x86)\Skybot\Skybot Scheduler\logs'
File 'C:\Program Files (x86)\Skybot\Skybot Scheduler\pgsql\data\pg_log'
SavePos TRUE
# ReadFromLast FALSE
Exec $Message = $raw_event;
</Input>

Re: Multiple input files syntax

Posted: Fri Jan 12, 2018 10:30 am
by npolovenko
@dlukinski, Without testing it I'd say the first option should work. However, Input names have to be different. So if the first one is windowsfile, the second one can be windowsfile2.
You could post your questions regarding nxlog on their forums directly: https://nxlog.co/community-forum

Re: Multiple input files syntax

Posted: Fri Jan 12, 2018 12:46 pm
by mcapra
You would also need to modify your Route definition to include the additional Input name(s):

Code: Select all

<Route 1>
    Path windowsfile, windowsfile2, ... windowsfilen => out
</Route>
nxlog should give you a warning in its log file if you have a non-routed Input, though.

Re: Multiple input files syntax

Posted: Fri Jan 12, 2018 1:14 pm
by npolovenko
Thanks, @mcapra!

Re: Multiple input files syntax

Posted: Tue Jan 23, 2018 1:51 pm
by dlukinski
mcapra wrote:You would also need to modify your Route definition to include the additional Input name(s):

Code: Select all

<Route 1>
    Path windowsfile, windowsfile2, ... windowsfilen => out
</Route>
nxlog should give you a warning in its log file if you have a non-routed Input, though.
Thank you. all worked

Please close the case