From: eldy <> Date: Fri, 18 Oct 2002 13:15:36 +0000 (+0000) Subject: Added tag %Dw-n for LogFile parameter (replaced with the day number in week but diffe... X-Git-Tag: AWSTATS_5_1_BETA~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f708176dfe647be47cc017ab1d543bbebe1ec80f;p=thirdparty%2FAWStats.git Added tag %Dw-n for LogFile parameter (replaced with the day number in week but differs from %DW-n because start with 0). --- diff --git a/docs/awstats.pdf b/docs/awstats.pdf index 1ee18ead..30fe1050 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 23fe202b..3e37f6e2 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -17,6 +17,8 @@ AWStats Changelog - New parameter: Added URLNotCaseSensitive. - New parameter: Added URLWithQueryWithoutFollowingParameters to exclude some parameters from URL when URLWithQuery is on. +- Added tag %Dw-n for LogFile parameter (replaced with the day number in week + but differs from %DW-n because start with 0). - Fixed: -debug option is allowed in migrate. - Fixed: Wrong window was opened when clicking on flag link when UseFramesWhenCGI was on. diff --git a/docs/awstats_config.html b/docs/awstats_config.html index 253a9ca6..fdeae766 100644 --- a/docs/awstats_config.html +++ b/docs/awstats_config.html @@ -196,6 +196,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

# "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" @@ -213,6 +214,8 @@ when reading it), follow the example:

# %WY-n is replaced with the week number in year (1-52)
# %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) +
# use n=24 if you need (0-6, 0=monday)
# Use 0 for n if you need current year, month, day, hour...
# Example: "/var/log/access_log.%YYYY-0%MM-0%DD-0.log"
# Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log" diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 00a4a281..7e5e0af7 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -33,6 +33,8 @@ # %WY-n is replaced with the week number in year (1-52) # %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) +# use n=24 if you need (0-6, 0=monday) # Use 0 for n if you need current year, month, day, hour... # Example: "/var/log/access_log.%YYYY-0%MM-0%DD-0.log" # Example: "C:/WINNT/system32/LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log" diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 2830a45e..4586cf4c 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -1411,14 +1411,15 @@ sub Check_Config { if ($oldersec < 10) { $oldersec = "0$oldersec"; } # Replace tag with new value if ($timetag =~ /YYYY/i) { $LogFile =~ s/%YYYY-$timephase/$olderyear/ig; next; } - if ($timetag =~ /YY/i) { $LogFile =~ s/%YY-$timephase/$oldersmallyear/ig; next; } - if ($timetag =~ /MM/i) { $LogFile =~ s/%MM-$timephase/$oldermonth/ig; next; } - if ($timetag =~ /DD/i) { $LogFile =~ s/%DD-$timephase/$olderday/ig; next; } - if ($timetag =~ /HH/i) { $LogFile =~ s/%HH-$timephase/$olderhour/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 =~ /DW/i) { $LogFile =~ s/%DW-$timephase/$olderwday/ig; next; } - if ($timetag =~ /NS/i) { $LogFile =~ s/%NS-$timephase/$olderns/ig; next; } + if ($timetag =~ /YY/i) { $LogFile =~ s/%YY-$timephase/$oldersmallyear/ig; next; } + if ($timetag =~ /MM/i) { $LogFile =~ s/%MM-$timephase/$oldermonth/ig; next; } + 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 =~ /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 error("Error: Unknown tag '\%$timetag' in LogFile parameter."); } @@ -1428,10 +1429,11 @@ sub Check_Config { $LogFile =~ s/%MM/$nowmonth/ig; $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/%DW/$nowwday/ig; - $LogFile =~ s/%NS/$nowns/ig; + $LogFile =~ s/%DW/$nowwday/g; + my $nowwday0=$nowwday-1; $LogFile =~ s/%Dw/$nowwday0/g; $LogFormat =~ s/\\//g; if ($Debug) { debug(" LogFile='$LogFile'",2);