From: Darold Date: Sun, 7 Oct 2012 20:44:33 +0000 (+0200) Subject: Fix autodetect log format to handle with additional info like: [ID * local2.info... X-Git-Tag: v3.2~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8455d2ec75b7ad7d9e80186be4ca91ba27979410;p=pgbadger Fix autodetect log format to handle with additional info like: [ID * local2.info] in syslog format. --- diff --git a/pgbadger b/pgbadger index cf86551..89c760e 100755 --- a/pgbadger +++ b/pgbadger @@ -3678,7 +3678,7 @@ sub autodetect_format $nline++; # Is syslog lines ? - if ($line =~ /^[A-Z][a-z]{2}\s+\d+\s\d+:\d+:\d+\s[^\s]+\s([^\[]+)\[\d+\]:\s\[[0-9\-]+\](.*?)(LOG|WARNING|ERROR|FATAL|PANIC|DETAIL|STATEMENT|HINT|CONTEXT):\s+$duration/) { + if ($line =~ /^[A-Z][a-z]{2}\s+\d+\s\d+:\d+:\d+\s[^\s]+\s([^\[]+)\[\d+\]:(.*?)\s\[[0-9\-]+\](.*?)(LOG|WARNING|ERROR|FATAL|PANIC|DETAIL|STATEMENT|HINT|CONTEXT):\s+$duration/) { $fmt = 'syslog'; $nfound++; $ident_name{$1}++;