From 197e4729b0b1b28d50a7199e48904626d6dc3ee4 Mon Sep 17 00:00:00 2001 From: John Salter Date: Mon, 2 Sep 2024 18:27:59 +0100 Subject: [PATCH] Improve regexes for log-file error and warning counts --- mysqltuner.pl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index cd860460..2f06e77c 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -1590,12 +1590,9 @@ sub log_file_recommendations { while ( my $logLi = <$fh> ) { chomp $logLi; $numLi++; - debugprint "$numLi: $logLi" - if $logLi =~ /warning|error/i and $logLi !~ /Logging to/; - $nbErrLog++ - if $logLi =~ /error/i - and $logLi !~ /(Logging to|\[Warning\].*ERROR_FOR_DIVISION_BY_ZERO)/; - $nbWarnLog++ if $logLi =~ /warning/i; + debugprint "$numLi: $logLi" if $logLi =~ /\[(warning|error)\]/i; + $nbErrLog++ if $logLi =~ /\[error\]/i; + $nbWarnLog++ if $logLi =~ /\[warning\]/i; push @lastShutdowns, $logLi if $logLi =~ /Shutdown complete/ and $logLi !~ /Innodb/i; push @lastStarts, $logLi if $logLi =~ /ready for connections/;