Handle missing HOSTNAME field in mock syslog server
authorJacob Bachmeyer <jcb@gnu.org>
Sat, 27 Feb 2021 03:18:31 +0000 (21:18 -0600)
committerJacob Bachmeyer <jcb@gnu.org>
Sat, 27 Feb 2021 03:18:31 +0000 (21:18 -0600)
testsuite/lib/exec/minlogd.pl

index 5d7f66284cbf3fc45ab2824b1b9c7cb16a2e80b5..610cb6c06f5254339219192c8cc103b3a324439d 100755 (executable)
@@ -148,7 +148,7 @@ sub handle_message ($) {
       { $TIMESTAMP =
          strftime '%Y-%m-%dT%H:%M:%S', localtime }
 
-    if (m/\G(\S+) /gc) { $HOSTNAME = $1 }
+    if (m/\G([-[:alnum:]]+) /gc) { $HOSTNAME = $1 }
     else { $HOSTNAME = 'localhost' }
 
     $MSG = substr $_, pos $_ if pos $_;