From 65b905817f90eff2113229274692e92b05336181 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Wed, 3 Mar 2021 20:40:08 -0600 Subject: [PATCH] Relax parsing of RFC3164 syslog message format --- testsuite/lib/exec/minlogd.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 $_; -- 2.25.1