From: eldy <> Date: Thu, 10 Oct 2002 21:09:04 +0000 (+0000) Subject: Added URLWithQueryWithoutFollowingParameters parameter to exclude some parameters... X-Git-Tag: AWSTATS_5_1_BETA~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcff6f868a619b2187e31f9389b23dc8d985d553;p=thirdparty%2FAWStats.git Added URLWithQueryWithoutFollowingParameters parameter to exclude some parameters from URL when URLWithQuery is on. --- diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index 163dbdd1..cd082d02 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -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). diff --git a/docs/awstats_config.html b/docs/awstats_config.html index d99b5a81..4b210fd8 100644 --- a/docs/awstats_config.html +++ b/docs/awstats_config.html @@ -81,6 +81,7 @@ when reading it), follow the example:
  • NotPageList
  • ValidHTTPCodes
  • URLWithQuery +
  • URLWithQueryWithoutFollowingParameters
  • WarningMessages
  • NbOfLinesForCorruptedLog
  • SplitSearchString @@ -408,8 +409,8 @@ when reading it), follow the example:

    # 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 @@ -572,7 +573,7 @@ when reading it), follow the example:

    # 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 @@ -745,16 +746,36 @@ when reading it), follow the example:

    # 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?x=y") +
    # 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y")
    # Default: 0
    #
    URLWithQuery=0


    +URLWithqueryWithoutFollowingParameters
    +Version : 5.1 +
    +
    # 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="" + +


    + WarningMessages
    Version : 1.0 +

    # AWStats can detect setup problems or show you important informations to have diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index a96ad7cd..8309d1fc 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -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 diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index f6cc73ff..01b89c12 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -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