From: Darold Gilles Date: Mon, 10 Mar 2014 15:46:37 +0000 (+0100) Subject: Fix additional message at end of query or error when it was logged from application... X-Git-Tag: v5.1~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23bc29551c817dea75c4cd6ecb6d34db64eaa78b;p=pgbadger Fix additional message at end of query or error when it was logged from application output. Thanks to Herve Werner for the report. --- diff --git a/pgbadger b/pgbadger index 562e4bd..d264460 100755 --- a/pgbadger +++ b/pgbadger @@ -1690,6 +1690,9 @@ sub process_file next; } + # Some log line may be written by applications + next if ($line =~ / LOG: /); + if (exists $cur_temp_info{$cur_pid}{query}) { $cur_temp_info{$cur_pid}{query} .= "\n" . $t_query; } elsif (exists $cur_lock_info{$cur_pid}{query}) { @@ -1707,6 +1710,9 @@ sub process_file # Collect orphaned lines of multiline queries } elsif ($cur_pid && ($line !~ $orphan_syslog_line)) { + # Some log line may be written by applications + next if ($line =~ / LOG: /); + if (exists $cur_temp_info{$cur_pid}{query}) { $cur_temp_info{$cur_pid}{query} .= "\n" . $line; } elsif (exists $cur_lock_info{$cur_pid}{query}) { @@ -1810,6 +1816,10 @@ sub process_file $cur_info{$cur_pid}{parameters} .= " $line"; next; } + + # Some log line may be written by applications + next if ($line =~ / LOG: /); + if (exists $cur_temp_info{$cur_pid}{query}) { $cur_temp_info{$cur_pid}{query} .= "\n" . $line; } elsif (exists $cur_lock_info{$cur_pid}{query}) {