4
responses

hi everyone

I've been searching this forum and the web, but can't find if there is a way to make nxlog include its version in the syslogs it forwards out

Thanks!

AskedOctober 8, 2018 - 7:35pm

Answers (2)

I don't know where you are wanting to store the value, but you could add some config to parse the syslog and then modify one of the fields like $SourceName or $Message, for instance.

<Exec>  
    parse_syslog();  
    $Message = "NXLog-CE 2.10.2102; " + $Message;  
    to_syslog_ietf();  
</Exec>  

Comments (2)

  • aleksandrc's picture

    i'm hoping that there is a way for use some variable, not a hardcoded value.
    basically i want to know nxlog versons of all the hosts that send log to me.

  • Zhengshi's picture
    (NXLog)

    in NXLog EE, you can use the nxlog_version() that b0ti mentioned.

    NXLog CE does not have that function. An alternative could be to populate a file with the version and include it.
    Something like the following, and you could run this from cron maybe.

    [root@rhel7_base ~]# echo "define NXVER \"$(/bin/nxlog -h|grep nxlog-ce|cut -d'-' -f3)\"">/tmp/test.conf 
    

    Then add include /tmp.test.conf in your nxlog.conf.
    You would reference it as any other define, %NXVER%.

    Note that this is not tested, but it should work.