]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix LogFormat=4 with url containing spaces.
authorLaurent Destailleur <eldy@destailleur.fr>
Mon, 20 Feb 2017 23:35:19 +0000 (00:35 +0100)
committerLaurent Destailleur <eldy@destailleur.fr>
Mon, 20 Feb 2017 23:35:19 +0000 (00:35 +0100)
wwwroot/cgi-bin/awstats.pl

index 75f0ed958a1d112ea12f75bd1efccaa5e1234811..ee8b4a214d98248fbbd326def4bc03e0e318592d 100755 (executable)
@@ -9021,9 +9021,12 @@ sub DefinePerlParsingFormat {
                        );
                }
                elsif ( $LogFormat eq '4' ) {    # Same than "%h %l %u %t \"%r\" %>s %b"
-                        # %u (user) is "(.+)" instead of "[^ ]+" because can contain space (Lotus Notes).
-                       $PerlParsingFormat =
-"([^ ]+) [^ ]+ (.+) \\[([^ ]+) [^ ]+\\] \\\"([^ ]+) ([^ ]+)(?: [^\\\"]+|)\\\" ([\\d|-]+) ([\\d|-]+)";
+                       # %u (user) is "(.+)" instead of "[^ ]+" because can contain space (Lotus Notes).
+                       # Sample: 10.100.10.45 - BMAA\will.smith [01/Jul/2013:07:17:28 +0200] "GET /Download/__Omnia__Aus- und Weiterbildung__Konsular- und Verwaltungskonferenz, Programm.doc HTTP/1.1" 200 9076810
+#                      $PerlParsingFormat = 
+#"([^ ]+) [^ ]+ (.+) \\[([^ ]+) [^ ]+\\] \\\"([^ ]+) ([^ ]+)(?: [^\\\"]+|)\\\" ([\\d|-]+) ([\\d|-]+)";
+                       $PerlParsingFormat = 
+"([^ ]+) [^ ]+ (.+) \\[([^ ]+) [^ ]+\\] \\\"([^ ]+) (.+) [^\\\"]+\\\" ([\\d|-]+) ([\\d|-]+)";
                        $pos_host    = 0;
                        $pos_logname = 1;
                        $pos_date    = 2;
@@ -9202,6 +9205,7 @@ sub DefinePerlParsingFormat {
                                $i++;
                                push @fieldlib, 'url';
                                $PerlParsingFormat .=
+
 #"\\\"([^$LogSeparatorWithoutStar]+) ([^$LogSeparatorWithoutStar]+) [^\\\"]+\\\"";
 "\\\"([^$LogSeparatorWithoutStar]+) ([^$LogSeparatorWithoutStar]+)(?: [^\\\"]+|)\\\"";
                        }