From 2ff6f188176bacaa281e5dcfaf0ebf85c4edaaef Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 8 Dec 2025 18:42:02 +0100 Subject: [PATCH] profiling: logwatch extension (incl. skip not interesting lines) --- contrib/logwatch/radicale | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/contrib/logwatch/radicale b/contrib/logwatch/radicale index 7cc1b1b8..1cdddc30 100644 --- a/contrib/logwatch/radicale +++ b/contrib/logwatch/radicale @@ -126,11 +126,35 @@ while (defined($ThisLine = )) { elsif ( $ThisLine =~ / (Failed login attempt) /o ) { $OtherEvents{$1}++; } + elsif ( $ThisLine =~ / (Profiling data per request method \S+) /o ) { + my $info = $1; + if ( $ThisLine =~ /(no request seen so far)/o ) { + $OtherEvents{$info . " - " . $1}++; + } else { + $OtherEvents{$info}++; + }; + } + elsif ( $ThisLine =~ / (Profiling data per request \S+) /o ) { + my $info = $1; + if ( $ThisLine =~ /(suppressed because duration below minimum|suppressed because of no data)/o ) { + $OtherEvents{$info . " - " . $1}++; + } else { + $OtherEvents{$info}++; + }; + } elsif ( $ThisLine =~ /\[(DEBUG|INFO)\] /o ) { # skip if DEBUG+INFO } else { # Report any unmatched entries... + if ($ThisLine =~ /^({\'| )/o) { + # skip profiling or raw header data + next; + }; + if ($ThisLine =~ /^$/o) { + # skip empty line + next; + }; $ThisLine =~ s/^\[\d+(\/Thread-\d+)?\] //; # remove process/Thread ID chomp($ThisLine); $OtherList{$ThisLine}++;