]> granicus.if.org Git - pgbadger/commitdiff
Allow single white space after duration even if this should not appear.
authorDarold Gilles <gilles@darold.net>
Wed, 15 Jul 2015 07:17:37 +0000 (09:17 +0200)
committerDarold Gilles <gilles@darold.net>
Wed, 15 Jul 2015 07:17:37 +0000 (09:17 +0200)
pgbadger

index c156f49c3734ee2847a2cf8b48d44d2273ceb7f9..64c5ce40b8fc100a98117ff9870e66c6beea87d1 100755 (executable)
--- 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) {