From: Jacob Bachmeyer Date: Thu, 4 Mar 2021 02:40:08 +0000 (-0600) Subject: Relax parsing of RFC3164 syslog message format X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=65b905817f90eff2113229274692e92b05336181;p=gatekeeper.git Relax parsing of RFC3164 syslog message format --- diff --git a/testsuite/lib/exec/minlogd.pl b/testsuite/lib/exec/minlogd.pl index e018f29..4d60095 100755 --- a/testsuite/lib/exec/minlogd.pl +++ b/testsuite/lib/exec/minlogd.pl @@ -140,8 +140,8 @@ sub handle_message ($) { if (m/^(<[[:digit:]]+>)/g) { $PRI = $1 } else { $PRI = '<13>' } - if (m/\G(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s - (\d{2})\s(\d{2}):(\d{2}):(\d{2})\s/gcx) + if (m/\G(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+ + (\d{1,2})\s+(\d{2}):(\d{2}):(\d{2})\s+/gcx) { $TIMESTAMP = strftime '%Y-%m-%dT%H:%M:%S', $5, $4, $3, $2, $Months{$1}-1, (localtime)[5..8] } @@ -149,7 +149,7 @@ sub handle_message ($) { { $TIMESTAMP = strftime '%Y-%m-%dT%H:%M:%S', localtime } - if (m/\G([-[:alnum:]]+) /gc) { $HOSTNAME = $1 } + if (m/\G([-[:alnum:]]+) +/gc) { $HOSTNAME = $1 } else { $HOSTNAME = 'localhost' } $MSG = substr $_, pos $_ if pos $_;