]> granicus.if.org Git - pgbadger/commitdiff
Fix another issue in log_line_prefix parser with stderr format
authorDarold <gilles@darold.net>
Sun, 9 Sep 2012 10:04:46 +0000 (12:04 +0200)
committerDarold <gilles@darold.net>
Sun, 9 Sep 2012 10:04:46 +0000 (12:04 +0200)
pgbadger

index 13549a7fecd01199582402840764117c0d1ed2ed..d8d44f1ee053bdb48c76209487bc6dcf8fdb8e2f 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -284,8 +284,8 @@ if ($log_line_prefix) {
        $compiled_prefix = qr/^(...)\s+(\d+)\s(\d+):(\d+):(\d+)\s([^\s]+)\s([^\[]+)\[(\d+)\]:\s\[([0-9\-]+)\]\s*(.*?)\s*(LOG|WARNING|ERROR|FATAL|PANIC|DETAIL|STATEMENT|HINT|CONTEXT):\s+(.*)/;
        push(@prefix_params, 't_month', 't_day', 't_hour', 't_min', 't_sec', 't_host', 't_ident', 't_pid', 't_session_line', 't_logprefix', 't_loglevel', 't_query');
 } elsif ($format eq 'stderr') {
-       $compiled_prefix = qr/^(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)[\.\d]*\s[^\s]+\s\[(\d+)\]:\s\[([0-9\-]+)\]\s*(.*?)\s*(LOG|WARNING|ERROR|FATAL|PANIC|DETAIL|STATEMENT|HINT|CONTEXT):\s+(.*)/;
-       push(@prefix_params, 't_year', 't_month', 't_day', 't_hour', 't_min', 't_sec', 't_pid', 't_session_line', 't_logprefix', 't_loglevel', 't_query');
+       $compiled_prefix = qr/^(\d+-\d+-\d+\s\d+:\d+:\d+)[\.\d]*\s[^\s]+\s\[(\d+)\]:\s\[([0-9\-]+)\]\s*(.*?)\s*(LOG|WARNING|ERROR|FATAL|PANIC|DETAIL|STATEMENT|HINT|CONTEXT):\s+(.*)/;
+       push(@prefix_params, 't_timestamp', 't_pid', 't_session_line', 't_logprefix', 't_loglevel', 't_query');
 }
 
 sub check_regex
@@ -651,7 +651,6 @@ foreach my $logfile (@log_files) {
                                        }
 
                                } else {
-print STDERR "ZZZZZZZZZZZZZZZZZ $line\n";
                                        $cur_info{$cur_pid}{query} .= "\n" . $line if ($cur_info{$cur_pid}{query});
                                }