From: eldy <> Date: Tue, 22 Oct 2002 11:18:39 +0000 (+0000) Subject: Added tag %Wm-n for LogFile parameter (replaced with the week number in month but... X-Git-Tag: AWSTATS_5_1_RELEASE~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1a8a7d68c08b119bb464a402fd9b825d647d303;p=thirdparty%2FAWStats.git Added tag %Wm-n for LogFile parameter (replaced with the week number in month but differs from %WM-n because start with 0). Added tag %Wy-n for LogFile parameter (replaced with the week number in year but differs from %WY-n because start with 0). --- diff --git a/docs/awstats.pdf b/docs/awstats.pdf index 336c7143..0a0a7fe4 100644 Binary files a/docs/awstats.pdf and b/docs/awstats.pdf differ diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index 6f0bf677..fdc0ba3f 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -18,6 +18,10 @@ AWStats Changelog - New parameter: Added URLWithQueryWithoutFollowingParameters to exclude some parameters from URL when URLWithQuery is on. - New parameter: Added URLReferrerWithquery. +- Added tag %Wm-n for LogFile parameter (replaced with the week number in month + but differs from %WM-n because start with 0). +- Added tag %Wy-n for LogFile parameter (replaced with the week number in year + but differs from %WY-n because start with 0). - Added tag %Dw-n for LogFile parameter (replaced with the day number in week but differs from %DW-n because start with 0). - Fixed: Log analyze is no more stopped if log file contains binary chars. diff --git a/docs/awstats_config.html b/docs/awstats_config.html index ffa7b6ae..ee7f5de6 100644 --- a/docs/awstats_config.html +++ b/docs/awstats_config.html @@ -197,7 +197,7 @@ when reading it), follow the example:
4.0+ for tag %DW-n
4.1+ for tag %NS-n
5.0+ for tag %WY-n
-5.1+ for tag %Dw-n
+5.1+ for tag %Wm-n, %Wy-n, %Dw-n

# "LogFile" contains the web server logfile to analyze.
# You can use a full path or relative path from awstats.pl directory.
# Example: "/var/log/apache/access.log" @@ -212,7 +212,9 @@ when reading it), follow the example:

# %HH-n is replaced with hour we were n hours ago
# %NS-n is replaced with number of seconds at 00:00 since 1970
# %WM-n is replaced with the week number in month (1-5) +
# %Wm-n is replaced with the week number in month (0-4)
# %WY-n is replaced with the week number in year (1-52) +
# %Wy-n is replaced with the week number in year (0-51)
# %DW-n is replaced with the day number in week (1-7, 1=sunday)
# use n=24 if you need (1-7, 1=monday)
# %Dw-n is replaced with the day number in week (0-6, 0=sunday) @@ -266,6 +268,8 @@ when reading it), follow the example:

# %gzipin Mod_gzip compression input bytes: In:XXX
# %gzipout Mod_gzip compression output bytes & ratio: Out:YYY:ZZZpct.
# %gzipratio Mod_gzip compression ratio: ZZZpct. +
# %email EMail sender (for mail log) +
# %email_r EMail receiver (for mail log)
# %syslog Syslog-specific time and host stamp with format: Mon dd hh:mm:ss hostname
# %virtualname Web sever virtual hostname. Use this tag when same log
# file contains data of several virtual web servers. The @@ -273,10 +277,11 @@ when reading it), follow the example:

# If your log format has some fields not included in this list, use
# %other Means another field
# -
# Examples for Apache combined logs (this two examples are equivalent): +
# Examples for Apache combined logs (following two examples are equivalent):
# LogFormat = 1
# LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" -
# Examples for IIS (this two examples are equivalent): +
# +
# Examples for IIS (following two examples are equivalent):
# LogFormat = 2
# LogFormat = "%time2 %host %logname %method %url %code %bytesd %other %ua %referer"
# diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 3c324c22..9e4857ea 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -30,7 +30,9 @@ # %HH-n is replaced with hour we were n hours ago # %NS-n is replaced with number of seconds at 00:00 since 1970 # %WM-n is replaced with the week number in month (1-5) +# %Wm-n is replaced with the week number in month (0-4) # %WY-n is replaced with the week number in year (1-52) +# %Wy-n is replaced with the week number in year (0-51) # %DW-n is replaced with the day number in week (1-7, 1=sunday) # use n=24 if you need (1-7, 1=monday) # %Dw-n is replaced with the day number in week (0-6, 0=sunday) @@ -85,11 +87,11 @@ LogFile="/var/log/apache/access.log" # If your log format has some fields not included in this list, use # %other Means another field not used # -# Examples for Apache combined logs (this two examples are equivalent): +# Examples for Apache combined logs (following two examples are equivalent): # LogFormat = 1 # LogFormat = "%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" # -# Examples for IIS (this two examples are equivalent): +# Examples for IIS (following two examples are equivalent): # LogFormat = 2 # LogFormat = "%time2 %host %logname %method %url %code %bytesd %other %ua %referer" # diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index ab4b153b..8ebec036 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -1423,8 +1423,10 @@ sub Check_Config { if ($timetag =~ /DD/i) { $LogFile =~ s/%DD-$timephase/$olderday/ig; next; } if ($timetag =~ /HH/i) { $LogFile =~ s/%HH-$timephase/$olderhour/ig; next; } if ($timetag =~ /NS/i) { $LogFile =~ s/%NS-$timephase/$olderns/ig; next; } - if ($timetag =~ /WM/i) { $LogFile =~ s/%WM-$timephase/$olderweekofmonth/ig; next; } - if ($timetag =~ /WY/i) { $LogFile =~ s/%WY-$timephase/$olderweekofyear/ig; next; } + if ($timetag =~ /WM/) { $LogFile =~ s/%WM-$timephase/$olderweekofmonth/g; next; } + if ($timetag =~ /Wm/) { my $olderweekofmonth0=$olderweekofmonth-1; $LogFile =~ s/%Wm-$timephase/$olderweekofmonth0/g; next; } + if ($timetag =~ /WY/) { $LogFile =~ s/%WY-$timephase/$olderweekofyear/g; next; } + if ($timetag =~ /Wy/) { my $olderweekofyear0=$olderweekofyear-1; $LogFile =~ s/%Wy-$timephase/$olderweekofyear0/g; next; } if ($timetag =~ /DW/) { $LogFile =~ s/%DW-$timephase/$olderwday/g; next; } if ($timetag =~ /Dw/) { my $olderwday0=$olderwday-1; $LogFile =~ s/%Dw-$timephase/$olderwday0/g; next; } # If unknown tag @@ -1437,8 +1439,10 @@ sub Check_Config { $LogFile =~ s/%DD/$nowday/ig; $LogFile =~ s/%HH/$nowhour/ig; $LogFile =~ s/%NS/$nowns/ig; - $LogFile =~ s/%WM/$nowweekofmonth/ig; - $LogFile =~ s/%WY/$nowweekofyear/ig; + $LogFile =~ s/%WM/$nowweekofmonth/g; + my $nowweekofmonth0=$nowweekofmonth-1; $LogFile =~ s/%Wm/$nowweekofmonth0/g; + $LogFile =~ s/%WY/$nowweekofyear/g; + my $nowweekofyear0=$nowweekofyear-1; $LogFile =~ s/%Wy/$nowweekofyear0/g; $LogFile =~ s/%DW/$nowwday/g; my $nowwday0=$nowwday-1; $LogFile =~ s/%Dw/$nowwday0/g; $LogFormat =~ s/\\//g;