From: Darold Date: Sun, 9 Sep 2012 10:04:46 +0000 (+0200) Subject: Fix another issue in log_line_prefix parser with stderr format X-Git-Tag: v3.2~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67a35988647e10a00e6bf1984127143b68416913;p=pgbadger Fix another issue in log_line_prefix parser with stderr format --- diff --git a/pgbadger b/pgbadger index 13549a7..d8d44f1 100755 --- 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}); }