From: Darold Gilles Date: Wed, 15 Jul 2015 07:17:37 +0000 (+0200) Subject: Allow single white space after duration even if this should not appear. X-Git-Tag: v7.2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc4432d03342d567d6de8c9398191b87ce79b741;p=pgbadger Allow single white space after duration even if this should not appear. --- diff --git a/pgbadger b/pgbadger index c156f49..64c5ce4 100755 --- a/pgbadger +++ b/pgbadger @@ -10532,7 +10532,7 @@ sub parse_query my $t_action = ''; # Store query duration generated by log_min_duration >= 0 in postgresql.conf - if ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms (query|statement): //is) { + if ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms\s+(query|statement): //is) { $prefix_vars{'t_duration'} = $1; $t_action = $2; my $k = &get_hist_inbound($1, @histogram_query_time); @@ -10545,7 +10545,7 @@ sub parse_query return if (lc($1) eq 'prepare'); } # Log line with duration and statement from prepared queries - } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms (prepare|parse|bind|execute from fetch|execute)\s+[^:]+:\s//is) + } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms\s+(prepare|parse|bind|execute from fetch|execute)\s+[^:]+:\s//is) { $prefix_vars{'t_duration'} = $1; $t_action = $2; @@ -10560,7 +10560,7 @@ sub parse_query $overall_stat{histogram}{query_total}++; $prefix_vars{'t_bind'} = 1; # Activate storage of the explain plan generated by auto_explain - } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms plan://is) { + } elsif ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms\s+plan://is) { $cur_plan_info{$t_pid}{duration} = $1; # Log line without duration at all } elsif ($prefix_vars{'t_query'} =~ s/(query|statement): //is) {