3
responses

Hi I have this config:

<Input WarnLog>
    Module  im_file
    File 'C:\warnlog.txt'
</Input>
<Input SpamLog>
    Module  im_file
    File 'C:\spamlog.txt'
</Input>
 <Output out>
     Module      om_udp
     Host        192.168.1.2
     Port        5555
 </Output>
 <Route 1>
     Path     WarnLog => out
 </Route>
 <Route 2>
     Path     SpamLog => out
 </Route>

Warnlog look like this:

16.09.2022 11:54:54 Update  Updater: Switch modules type retval = 0x00005007 [NOT NEED] SYSTEM  
16.09.2022 11:54:54 Update  Updater: retval = 0x5003, failures: 0, profile: aktualizacja, trigger: ConfigChange SYSTEM  
16.09.2022 11:54:54 Update  Mirror: retval = 0x5003 SYSTEM

Spamlog:

16.09.2022 12:07:24 some@address.com    some@address.com    RE: subject 16.09.2022 12:04:59 0   No rule classifies the email    Retained    H|RN=0;RNP=  
16.09.2022 12:12:24 some@address.com    some@address.com    RE: subject 16.09.2022 12:09:51 0   No rule classifies the email    Retained    H|RN=0;RNP=

Everything works fine, i see messages on my syslog server, but i don't know what type of message it is. From spamlog or form warnlog. How can I add something to the end of each line before sending to syslog. Or there is other way?

AskedSeptember 16, 2022 - 12:49pm

Answer (1)

Hello Sir,

You can add text for example at the end or start of the line via concatenation for example.

Sincerely
Klevin

Comments (2)

  • 5ss0's picture

    Hello
    Thank you for your answer.
    Do you mean like this

    <Input SpamLog>
         Module  im_file
         File 'C:\spamlog.txt'
         Exec $raw_event =  $raw_event + "**test**";
     </Input>
    

    When I do this, on syslog server looks like this:

    message
        MS04911000624 <13>Sep 16 15:17:52 MS04911000624 1**test**
    

  • Klevin's picture
    (NXLog)

    You you can add that example if needed,

    Exec $raw_event =  $raw_event + " ** test ** ";
    

    In case you send parse the data into json format you can as well add a static value.

    Sincerely Klevin