Allow _ and - in extended messages key names

This commit is contained in:
Daniel Berteaud 2019-03-27 22:54:27 +01:00
parent 419c00a1dd
commit 2791d32e7c
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ while ( my $entry = <JOURNAL> ){
# OR
#
# gelf(~):code=200~url=/index.html~remote_ip=10.99.5.12~referer=http://test.local/
if ( $msg->{MESSAGE} =~ m/^gelf(\([^\(\)]+\))?:([a-zA-Z\d]+=([^\|])\|?)+/ ){
if ( $msg->{MESSAGE} =~ m/^gelf(\([^\(\)]+\))?:([a-zA-Z\d_\-]+=([^\|])\|?)+/ ){
$msg->{MESSAGE} =~ s/^gelf(\([^\(\)]+\))?://;
my $separator = ($1 && length $1 > 0) ? qr{$1} : qr{\|};
foreach ( split /$separator/, $msg->{MESSAGE} ){