From: Laurent Destailleur Date: Mon, 20 Feb 2017 23:35:19 +0000 (+0100) Subject: Fix LogFormat=4 with url containing spaces. X-Git-Tag: AWSTATS_7_7~7 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a0e4c19ac4d61b261a72659aff48eef4ee93d353;p=thirdparty%2FAWStats.git Fix LogFormat=4 with url containing spaces. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 75f0ed95..ee8b4a21 100755 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -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]+)(?: [^\\\"]+|)\\\""; }