From: eldy <> Date: Sat, 13 Jan 2001 23:26:45 +0000 (+0000) Subject: Better management of corrupted log files. X-Git-Tag: AWSTATS_1_0~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21dbe184e3fc60ae1fafe35c93fc44bcfa137f61;p=thirdparty%2FAWStats.git Better management of corrupted log files. --- diff --git a/awstats.pl b/awstats.pl index 96552bf6..a0b865ef 100644 --- a/awstats.pl +++ b/awstats.pl @@ -14,7 +14,7 @@ #------------------------------------------------------- # Defines #------------------------------------------------------- -$VERSION="2.24 (build 7)"; +$VERSION="2.24 (build 8)"; $Lang=0; # Default value @@ -1664,7 +1664,7 @@ if (($YearRequired == $nowyear) && ($MonthRequired eq "year" || $MonthRequired = if ("$filearray[$i]" =~ /^$PROG[\d][\d][\d][\d][\d][\d]$FileSuffix\.txt$/) { $yearmonth=$filearray[$i]; $yearmonth =~ s/^$PROG//; $yearmonth =~ s/\..*//; # Reverse year and month - $yearfile=$yearmonth; $monthfile=$yearmonth; $yearfile =~ s/^..//; $monthfile =~ s/....$//; + $yearfile=$yearmonth; $monthfile=$yearmonth; $yearfile =~ s/^..//; $monthfile =~ s/....$//; $yearmonth="$yearfile$monthfile"; if ($yearmonth > $yearmonthchoosed) { $yearmonthchoosed=$yearmonth; } } @@ -1733,7 +1733,8 @@ if (($YearRequired == $nowyear) && ($MonthRequired eq "year" || $MonthRequired = # Check filters (here, log is in apache combined format, even with IIS) #---------------------------------------------------------------------- - if ($felter[5] eq 'HEAD') { next; } # Keep only GET, POST, OPTIONS but not HEAD + if ($felter[5] eq 'HEAD') { next; } # Keep only GET, POST but not HEAD, OPTIONS + if ($felter[5] eq 'OPTIONS') { next; } # Keep only GET, POST but not HEAD, OPTIONS if ($felter[6] =~ /^RC=/) { next; } # A strange log record we need to forget $felter[3] =~ s/\//:/g; @@ -1756,11 +1757,11 @@ if (($YearRequired == $nowyear) && ($MonthRequired eq "year" || $MonthRequired = print "
LogFormat parameter is $LogFormat, this means each line in your log file need to have "; if ($LogFormat == 2) { print "\"MSIE Extended W3C log format\" like this:
"; - print "date time c-ip c-username cs-method cs-uri-sterm sc-status cs-bytes cs-version cs(User-Agent) cs(Referer)
" + print "date time c-ip c-username cs-method cs-uri-sterm sc-status cs-bytes cs-version cs(User-Agent) cs(Referer)
"; } else { print "\"combined log format\" like this:
"; - print "62.161.78.73 - - [19/Jul/2000:02:14:14 +0200] \"GET / HTTP/1.1\" 200 1234 \"http://www.fromserver.com/from.htm\" \"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\"
"; + print "111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] \"GET / HTTP/1.1\" 200 1234 \"http://www.fromserver.com/from.htm\" \"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\"
"; } error("
"); # Exit with format error }