]> granicus.if.org Git - pgbadger/commitdiff
fix case where log line where not detected
authorDarold <gilles@darold.net>
Thu, 24 May 2012 03:54:55 +0000 (05:54 +0200)
committerDarold <gilles@darold.net>
Thu, 24 May 2012 03:54:55 +0000 (05:54 +0200)
pgbadger

index 574cc75713d66f2e10b5065d1f86d7e2b92ee4f3..86eaf15dde4209637e1d01461c686478ed06cb49 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -323,7 +323,7 @@ while (my $line = <$lfile>) {
 
        # Parse syslog lines
        if ($format eq 'syslog') {
-               if ($line =~ /^(...)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+([^\s]+)\s+([^\[]+)\[(\d+)\]:\s+\[([0-9\-]+)\]\s+([^\s]*)\s+([A-Z]+:)\s+(.*)/) {
+               if ($line =~ /^(...)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+([^\s]+)\s+([^\[]+)\[(\d+)\]:\s+\[([0-9\-]+)\]\s*([^\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
@@ -347,7 +347,7 @@ while (my $line = <$lfile>) {
        } elsif ($format eq 'stderr') {
 
                # Parse stderr lines
-               if ($line =~ /(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)\s+([^\s]+)\s+\[(\d+)\]:\s+\[([0-9\-]+)\]\s+([^\s]*)\s+([A-Z]+:)\s+(.*)/) {
+               if ($line =~ /(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)\s+([^\s]+)\s+\[(\d+)\]:\s+\[([0-9\-]+)\]\s*([^\s]*)\s+([A-Z]+:)\s+(.*)/) {
                        # Skip unwanted lines
                        my $cur_date = "$1$2$3$4$5$6";
                        next if ($from && ($from > $cur_date));