]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Added URLWithQueryWithoutFollowingParameters parameter to exclude some parameters...
authoreldy <>
Thu, 10 Oct 2002 21:09:04 +0000 (21:09 +0000)
committereldy <>
Thu, 10 Oct 2002 21:09:04 +0000 (21:09 +0000)
docs/awstats_changelog.txt
docs/awstats_config.html
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index 163dbdd137a7f83233b3531cab780a17458c1387..cd082d0261e62f5945915ff40d275cb4f725a552 100644 (file)
@@ -1,11 +1,15 @@
 AWStats Changelog
 -----------------
 
+
 5.1
 
 - New feature: ShowxxxStats parmaters accept codes to decide which columns to
   show in chart.
-- New parameter: Added SkipUserAgents parameter.
+- New parameter: Added SkipUserAgents parameter to exclude some user agent
+  from statistics.
+- New parameter: Added URLWithQueryWithoutFollowingParameters to exclude some
+  parameters from URL when URLWithQuery is on.
 - Fixed: Fixed pb in refreshing page when clicking on "Update Now" link (no
   need to force the refresh).
 - Fixed: Pb with SAMBAR server ('Expires' line appears at the top of pages).
index d99b5a81484d870988dbe467ce115e1c1f388428..4b210fd8d80e17eaeb488ed542a8d9bbfcf07074 100644 (file)
@@ -81,6 +81,7 @@ when reading it), follow the example:<br>
 <li><a href="#NotPageList">NotPageList</a>\r
 <li><a href="#ValidHTTPCodes">ValidHTTPCodes</a>\r
 <li><a href="#URLWithQuery">URLWithQuery</a>\r
+<li><a href="#URLWithQueryWithoutFollowingParameters">URLWithQueryWithoutFollowingParameters</a>\r
 <li><a href="#WarningMessages">WarningMessages</a>\r
 <li><a href="#NbOfLinesForCorruptedLog">NbOfLinesForCorruptedLog</a>\r
 <li><a href="#SplitSearchString">SplitSearchString</a>\r
@@ -408,8 +409,8 @@ when reading it), follow the example:<br>
 <br># same time to prevent unknown conflicts problems and avoid DoS attacks when\r
 <br># AllowToUpdateStatsFromBrowser is set to 1.\r
 <br># Because, when you use lock file, you can experience sometimes problems in\r
-<br># lock file not correctly removed (when process is killed for example that\r
-<br># require that you remove the file manualy), this option is not enabled by\r
+<br># lock file not correctly removed (when process is killed for example, this\r
+<br># requires that you remove the file manualy), this option is not enabled by\r
 <br># default (Do not enable this option with no consol server access).\r
 <br># Possible values: 0 or 1\r
 <br># Default: 0\r
@@ -572,7 +573,7 @@ when reading it), follow the example:<br>
 <br># ask AWStats to save last non corrupted file in a .bak file. This file is\r
 <br># stored in "DirData" directory with other 'historic files'.\r
 <br># Possible values: 0 or 1\r
-<br># Default: 1\r
+<br># Default: 0\r
 <br>#\r
 <br>KeepBackupOfHistoricFiles=0\r
 \r
@@ -745,16 +746,36 @@ when reading it), follow the example:<br>
 <br># different pages.\r
 <br># Warning, when set to 1, memory required to run AWStats is dramatically\r
 <br># increased if you have a lot of changing URLs (for example URLs with a random\r
-<br># id inside). Such web sites should not set this option to 1.\r
+<br># id inside). Such web sites should not set this option to 1 or use seriously\r
+<br># the next parameter URLWithQueryWithoutFollowingParameters.\r
 <br># Possible values:\r
 <br># 0 - URLs are cleaned from the query string (ie: "/mypage.html")\r
-<br># 1 - Full URL with query string is used     (ie: "/mypage.html?x=y")\r
+<br># 1 - Full URL with query string is used     (ie: "/mypage.html?p=x&q=y")\r
 <br># Default: 0\r
 <br># \r
 <br>URLWithQuery=0\r
 \r
 <br><br><hr>\r
 \r
+<a name="URLWithQueryWithoutFollowingParameters"><b>URLWithqueryWithoutFollowingParameters</b></a><br>\r
+<b>Version : </b>5.1 +<br>\r
+<br># When URLWithQuery is on, you will get the full URL with all parameters in\r
+<br># URL reports. But among thoose parameters, sometimes you don't need a\r
+<br># particular parameter because it does not identify the page or because it's\r
+<br># a random ID changing for each access even if URL points to same page. In\r
+<br># such cases, it is higly recommanded to ask AWStats to remove such parameters\r
+<br># from the URL before counting, manipulating and storing it. Enter here list\r
+<br># of all non wanted parameters. For example if you enter "id", one hit on\r
+<br># /mypage.cgi?p=abc&id=Yo4UomP9d and /mypage.cgi?p=abc&id=Mu8fdxl3r\r
+<br># will be reported as 2 hits on /mypage.cgi?p=abc\r
+<br># This parameter is not used when URLWithQuery is 0.\r
+<br># Example: "PHPSESSID"\r
+<br># Default: ""\r
+<br># \r
+<br>URLWithQueryWithoutFollowingParameters=""\r
+\r
+<br><br><hr>\r
+\r
 <a name="WarningMessages"><b>WarningMessages</b></a><br>\r
 <b>Version : </b>1.0 +<br>\r
 <br># AWStats can detect setup problems or show you important informations to have\r
index a96ad7cd4b90ff7910fb1159357e33079e9cb871..8309d1fc057af0224a424b7e532ed71a501b1f01 100644 (file)
@@ -207,8 +207,8 @@ AllowToUpdateStatsFromBrowser=0
 # same time to prevent unknown conflicts problems and avoid DoS attacks when
 # AllowToUpdateStatsFromBrowser is set to 1.
 # Because, when you use lock file, you can experience sometimes problems in
-# lock file not correctly removed (when process is killed for example that
-# require that you remove the file manualy), this option is not enabled by
+# lock file not correctly removed (when process is killed for example, this
+# requires that you remove the file manualy), this option is not enabled by
 # default (Do not enable this option with no consol server access).
 # Possible values: 0 or 1
 # Default: 0
@@ -340,7 +340,7 @@ ArchiveLogRecords=0
 # ask AWStats to save last non corrupted file in a .bak file. This file is
 # stored in "DirData" directory with other 'historic files'.
 # Possible values: 0 or 1
-# Default: 1
+# Default: 0
 #
 KeepBackupOfHistoricFiles=0
 
@@ -435,7 +435,8 @@ ValidHTTPCodes="200 304"
 # different pages.
 # Warning, when set to 1, memory required to run AWStats is dramatically
 # increased if you have a lot of changing URLs (for example URLs with a random
-# id inside). Such web sites should not set this option to 1.
+# id inside). Such web sites should not set this option to 1 or use seriously
+# the next parameter URLWithQueryWithoutFollowingParameters.
 # Possible values:
 # 0 - URLs are cleaned from the query string (ie: "/mypage.html")
 # 1 - Full URL with query string is used     (ie: "/mypage.html?p=x&q=y")
@@ -444,6 +445,22 @@ ValidHTTPCodes="200 304"
 URLWithQuery=0
 
 
+# When URLWithQuery is on, you will get the full URL with all parameters in
+# URL reports. But among thoose parameters, sometimes you don't need a
+# particular parameter because it does not identify the page or because it's
+# a random ID changing for each access even if URL points to same page. In
+# such cases, it is higly recommanded to ask AWStats to remove such parameters
+# from the URL before counting, manipulating and storing it. Enter here list
+# of all non wanted parameters. For example if you enter "id", one hit on
+# /mypage.cgi?p=abc&id=Yo4UomP9d and /mypage.cgi?p=abc&id=Mu8fdxl3r
+# will be reported as 2 hits on /mypage.cgi?p=abc
+# This parameter is not used when URLWithQuery is 0.
+# Example: "PHPSESSID"
+# Default: ""
+# 
+URLWithQueryWithoutFollowingParameters=""
+
+
 # AWStats can detect setup problems or show you important informations to have
 # a better use. Keep this to 1, except if AWStats says you can change it.
 # Possible values: 0 or 1
index f6cc73ff59cbeaa9afd75c037d270bf897f6e278..01b89c1249438b0cef7b47e06a7210544a79baaa 100644 (file)
@@ -212,6 +212,7 @@ use vars qw/
 use vars qw/
 @SessionsRange @HostAliases @AllowAccessFromWebToFollowingAuthenticatedUsers
 @DefaultFile @OnlyFiles @SkipDNSLookupFor @SkipFiles @SkipHosts @SkipUserAgents
+@URLWithQueryWithoutFollowingParameters
 @PluginsToLoad @DOWIndex @RobotsSearchIDOrder
 @_from_p @_from_h @_time_p @_time_h @_time_k
 @keylist
@@ -220,6 +221,7 @@ use vars qw/
 @HostAliases=();
 @AllowAccessFromWebToFollowingAuthenticatedUsers=();
 @DefaultFile = @OnlyFiles = @SkipDNSLookupFor = @SkipFiles = @SkipHosts = @SkipUserAgents = ();
+@URLWithQueryWithoutFollowingParameters = ();
 @PluginsToLoad = @DOWIndex = @RobotsSearchIDOrder = ();
 @_from_p = @_from_h = ();
 @_time_p = @_time_h = @_time_k = ();
@@ -1095,7 +1097,11 @@ sub Parse_Config {
                        $FoundValidHTTPCodes=1;
                        next;
                        }
-               if ($param =~ /^URLWithQuery/)                  { $URLWithQuery=$value; next; }
+               if ($param =~ /^URLWithQuery$/)                 { $URLWithQuery=$value; next; }
+               if ($param =~ /^URLWithQueryWithoutFollowingParameters$/)       {
+                       foreach my $elem (split(/\s+/,$value))  { push @URLWithQueryWithoutFollowingParameters,$elem; }
+                       next;
+                       }
                if ($param =~ /^WarningMessages/)       { $WarningMessages=$value; next; }
                if ($param =~ /^NbOfLinesForCorruptedLog/) { $NbOfLinesForCorruptedLog=$value; next; }
                if ($param =~ /^Expires/)               { $Expires=$value; next; }
@@ -4612,9 +4618,20 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat
                my $urlwithnoquery;
                if ($URLWithQuery) {
                        $urlwithnoquery=$field[$pos_url];
-                       $urlwithnoquery =~ s/\?.*//;
+                       my $foundparam=($urlwithnoquery =~ s/\?.*//);
                        # We combine the URL and query strings (for some IIS setup).
-                       if ($pos_query >=0 && $field[$pos_query] && $field[$pos_query] ne "-") { $field[$pos_url] .= "?" . $field[$pos_query]; }
+                       if (! $foundparam && $pos_query >=0 && $field[$pos_query] && $field[$pos_query] ne "-") {
+                               $foundparam=1;
+                               $field[$pos_url] .= "?" . $field[$pos_query];
+                       }
+                       # Remove params that are marked to be ignored in URLWithQueryWithoutFollowingParameters
+                       if ($foundparam && @URLWithQueryWithoutFollowingParameters) {
+                               map {$field[$pos_url] =~ s/$_=[^&]*//;} @URLWithQueryWithoutFollowingParameters;
+                               # Cut starting or trailing ? or &
+                               $field[$pos_url] =~ tr/&/&/s;
+                               $field[$pos_url] =~ s/\?&/\?/;
+                               $field[$pos_url] =~ s/[\?&]$//;
+                       }
                }
                else {
                        # Trunc CGI parameters in URL