From 9a9fbd8fe50beaf673ec85cf0b017b3c0fdfc875 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Wed, 7 Apr 2021 21:37:36 +0200 Subject: [PATCH 1/3] zmdailyreport: fix parsing of rsyslog precision timestamps --- src/libexec/zmdailyreport | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libexec/zmdailyreport b/src/libexec/zmdailyreport index 65d074ab6..9315d94d8 100755 --- a/src/libexec/zmdailyreport +++ b/src/libexec/zmdailyreport @@ -81,7 +81,7 @@ if (fork()) { while () { my $line = $_; - if ($line =~ /$today/o) { + if ($line =~ /$today|$datestring/o) { print PFOUT $line; $found = 1; } elsif ($found) { @@ -96,7 +96,7 @@ if (fork()) { $found = 0; while () { my $line = $_; - if ($line =~ /$today/o) { + if ($line =~ /$today|$datestring/o) { print PFOUT $line; $found = 1; } elsif ($found) { From 5ae63871897682d1cb491aeb9407d22da16b4d44 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Wed, 7 Apr 2021 21:38:18 +0200 Subject: [PATCH 2/3] zmlogger: fix parsing of rsyslog precision timestamps --- src/libexec/zmlogger | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexec/zmlogger b/src/libexec/zmlogger index d9ab6576a..8f205f3dc 100755 --- a/src/libexec/zmlogger +++ b/src/libexec/zmlogger @@ -524,7 +524,7 @@ sub killserver() { sub run() { my $dbh = init(); my $opened; - my $logregex = qr/(^.{15}) ((\d+\.\d+\.\d+\.\d+)|(\S+)) ([^[]+)(\[(\d+)\])?: (.*)$/o; + my $logregex = qr/^(.{15}|\S+) ((\d+\.\d+\.\d+\.\d+)|(\S+)) ([^[]+)(\[(\d+)\])?: (.*)$/o; my $fragre = qr/:::(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}):::$/o; my $fragnextre = qr/.*:::(\w{8}-\w{4}-\w{4}-\w{4}-\w{12}):::(?!$)/o; From a9c92330f0e3181a126a2e31e6415b3f4acb0f5b Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Wed, 7 Apr 2021 21:38:46 +0200 Subject: [PATCH 3/3] zmlogprocess: fix parsing of rsyslog precision timestamps --- src/libexec/zmlogprocess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexec/zmlogprocess b/src/libexec/zmlogprocess index 7ffce8218..a5b1faacb 100644 --- a/src/libexec/zmlogprocess +++ b/src/libexec/zmlogprocess @@ -224,7 +224,7 @@ sub run() { my $state = updateState(); open(LOG, "<$log_file") || die $!; - my $logregex = qr/(^.{15}) ((\d+\.\d+\.\d+\.\d+) \S+|(\S+)) ([^[]+)(\[(\d+)\])?: (.*)$/o; + my $logregex = qr/^(.{15}|\S+) ((\d+\.\d+\.\d+\.\d+) \S+|(\S+)) ([^[]+)(\[(\d+)\])?: (.*)$/o; my %host_data; my %host_qid_data; # hostname -> { qid -> { first, last } } init_counters(\%host_data);