]> granicus.if.org Git - pgbadger/commitdiff
handle syslog dates with single-digit day number
authorDenis Orlikhin <denis@ostrovok.ru>
Sun, 1 Jul 2012 22:04:16 +0000 (02:04 +0400)
committerDenis Orlikhin <denis@ostrovok.ru>
Sun, 1 Jul 2012 22:23:34 +0000 (02:23 +0400)
pgbadger

index a427f55663cef18ac0f6662e4f1712f8cbe3328d..b67bd20aad9dc4e8c9ba0e6e4e882a031ec700a1 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -385,7 +385,7 @@ foreach $logfile (@log_files) {
                # Parse syslog lines
                if ($format eq 'syslog') {
 
-                       if ($line =~ /^(...)\s(\d+)\s(\d+):(\d+):(\d+)\s([^\s]+)\s([^\[]+)\[(\d+)\]:\s\[([0-9\-]+)\]\s*(.*?)\s+([A-Z]+:)\s+(.*)/) {
+                       if ($line =~ /^(...)\s+(\d+)\s(\d+):(\d+):(\d+)\s([^\s]+)\s([^\[]+)\[(\d+)\]:\s\[([0-9\-]+)\]\s*(.*?)\s+([A-Z]+:)\s+(.*)/) {
                                # skip non postgresql lines
                                next if ($7 ne $ident);
                                # Syslog do not have year information, so take care of year overlapping
@@ -399,7 +399,7 @@ foreach $logfile (@log_files) {
                                last if ($to && ($to < $cur_date));
                                # Process the log line
                                &parse_query($tmp_year, $month_abbr{$1}, sprintf("%02d", $2), $3, $4, $5, $6, $8, $9, $10, $11,$12);
-                       } elsif ($line =~ /^(...)\s(\d+)\s(\d+):(\d+):(\d+)\s([^\s]+)\s([^\[]+)\[(\d+)\]:\s\[([0-9\-]+)\]\s+[^\#]*(#011)[\t\s]*(.*)/) {
+                       } elsif ($line =~ /^(...)\s+(\d+)\s(\d+):(\d+):(\d+)\s([^\s]+)\s([^\[]+)\[(\d+)\]:\s\[([0-9\-]+)\]\s+[^\#]*(#011)[\t\s]*(.*)/) {
 
                                $cur_info{query} .= "\n" . $11;
                        } else {