When I use xm_perl with this code from /usr/libexec/nxlog/modules/extension/perl/event1.pl:

use Log::Nxlog;
use strict;
use warnings;
use feature 'say';
use JSON;
use utf8;

sub rec2msg {
    my $msgsrcaddr = Log::Nxlog::get_field($event, 'MessageSourceAddress');
    if ( defined($msgsrcaddr) )
        Log::Nxlog::set_field_string($event, 'MessageSourceCountry', "France");

It gives me strange error:

syntax error at /usr/libexec/nxlog/modules/extension/perl/event1.pl line 16, at EOF

However , there is no code at line 16 at all. What does that mean? It happens when I use any perl code.

AskedApril 22, 2020 - 11:29am

Answer (1)

Can you please paste your nxlog.conf into a pastebin? So we can check it out? As error states, there is some kind of syntax error.