Multiple input files syntax

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Multiple input files syntax

Post 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>
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Multiple input files syntax

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: Multiple input files syntax

Post 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>
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Multiple input files syntax

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Multiple input files syntax

Post 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.
Former Nagios employee
https://www.mcapra.com/
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Multiple input files syntax

Post by npolovenko »

Thanks, @mcapra!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: Multiple input files syntax

Post 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
Locked