I am setting up NXLog Community Edition in an environment with multiple devices I want to monitor. I have already set up multiple routes of single inputs and outputs that does the job adequately, but I have a feeling I can get more complex and have less Routes to perform the same action. I have looked around the documentation and played with some prototypes but cannot find anything that works. So are any of the following ideas viable or does the Language prohibit them?

1) Input Branching. Is it possible to route specific incoming logs to specific outputs or routes based in properties (For me it is $MessageSourceAddress)? Either by tagging the data, manipulating route data, etc.

2) Processor Branching. Similar to #1, Is it possible to route or send logs to specific outputs based on properties (I am not sure if $MessageSourceAddress is usable in the processor or output modules). For example:

3) Output Filtering. Is it possible to choose output destination (for me it will be a file) based on log parameters (again $MessageSourceAddress)? I think is my best option. For example:
<Output Output_file>
Module om_file

If $MessageSourceAddress = X.X.X.X
File '\TestLogs\Test\ test.log'


else If $MessageSourceAddress = Y.Y.Y.Y
File '\TestLogs\Test2\ test2.log'


else If $MessageSourceAddress = Z.Z.Z.Z
File '\TestLogs\Test3\ test3.log'



Thanks in advance!

AskedAugust 12, 2022 - 5:51pm

Answer (1)