]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Can use UA and HOST fields to build personalized ExtraSection reports
authoreldy <>
Thu, 30 Oct 2003 13:31:08 +0000 (13:31 +0000)
committereldy <>
Thu, 30 Oct 2003 13:31:08 +0000 (13:31 +0000)
docs/awstats_changelog.txt
docs/awstats_config.html
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index 098da0d3f08293e57c975ad609d3060319cf65b4..6e40cd848ba23946c9846470b44773f2fd2e19f6 100644 (file)
@@ -19,6 +19,7 @@ New features/improvements:
 - Add percent column for file types.
 - Some changes to make AWStats to be XML compliant ready.
   Need to set the new parameter UseXMLForOutput to 1 in config file.
+- Can use UA and HOST fields to build personalized ExtraSection reports.
 
 Other/Documentation:
 - Prepare code for decodeUTFkeys plugin.
index 86bdd48ccfdf42749d10a96d51462f5e6c23077c..afba1ff0de08faa50b3a2c8b22f265992cd331ce 100644 (file)
@@ -1614,13 +1614,15 @@ color_u,color_v,color_p,color_h,color_k,color_s<br>
 <br># In most cases, you don't need this feature.
 <br>#
 <br># ExtraSectionNameX is title of your personalized chart.
-<br># ExtraSectionConditionalX are conditions on URL and/or QUERY_STRING and/or
-<br>#   REFERER you can use to count or not the hit. Use "|" for "OR".
+<br># ExtraSectionConditionalX are conditions you can use to count or not the hit,
+<br>#   Use one of the field condition (URL, QUERY_STRING, REFERER, UA, HOST)
+<br>#   and string to match after a coma. Use "|" for "OR".
 <br># ExtraSectionFirstColumnTitleX is the first column title of the chart.
-<br># ExtraSectionFirstColumnValuesX is a Regex string to tell AWStats how to 
-<br>#   extract the value used for first column. Each different value found will
-<br>#   be a different row. Be sure that list of different values is "limited" to
-<br>#   avoid "not enough memory" problems !
+<br># ExtraSectionFirstColumnValuesX is a Regex string to tell AWStats in which 
+<br>#   field to extract value from (URL, QUERY_STRING, REFERER, UA, HOST) and how
+<br>#   to extract the value. Each different value found will appear in first
+<br>#   column of report on a different row. Be sure that list of different values
+<br>#   is "limited" to avoid "not enough memory" problems !
 <br># ExtraSectionFirstColumnFormatX is the string used to write value.
 <br># ExtraSectionStatTypesX are things you want to count. You can use standard
 <br>#   code letters (P for pages,H for hits,B for bandwidth,L for last access).
index 63c86e595b6171216da38aa93f1dd9c5ea75bc49..aefbe73015824428366c12e49d4e81431a1af944 100644 (file)
@@ -1221,13 +1221,15 @@ color_x="C1B2E2"                                # Background color for number of exit pages (Default = "C1B2
 # In most cases, you don't need this feature.
 #
 # ExtraSectionNameX is title of your personalized chart.
-# ExtraSectionConditionalX are conditions on URL and/or QUERY_STRING and/or
-#   REFERER you can use to count or not the hit. Use "|" for "OR".
+# ExtraSectionConditionalX are conditions you can use to count or not the hit,
+#   Use one of the field condition (URL, QUERY_STRING, REFERER, UA, HOST)
+#   and string to match after a coma. Use "|" for "OR".
 # ExtraSectionFirstColumnTitleX is the first column title of the chart.
-# ExtraSectionFirstColumnValuesX is a Regex string to tell AWStats how to 
-#   extract the value used for first column. Each different value found will
-#   be a different row. Be sure that list of different values is "limited" to
-#   avoid "not enough memory" problems !
+# ExtraSectionFirstColumnValuesX is a Regex string to tell AWStats in which 
+#   field to extract value from (URL, QUERY_STRING, REFERER, UA, HOST) and how
+#   to extract the value. Each different value found will appear in first
+#   column of report on a different row. Be sure that list of different values
+#   is "limited" to avoid "not enough memory" problems !
 # ExtraSectionFirstColumnFormatX is the string used to write value.
 # ExtraSectionStatTypesX are things you want to count. You can use standard
 #   code letters (P for pages,H for hits,B for bandwidth,L for last access).
index ee9191969ec132937ec0100f4914ea7eaad13384..85868c5c724c22c3983d8a0a57b5d793bc832ddd 100644 (file)
@@ -6398,6 +6398,14 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat
                                        if ($Debug) { debug(" Check condition '$conditiontype' must contain '$conditiontypeval' in $field[$pos_referer]",5); }
                                        if ($field[$pos_referer] =~ m/$conditiontypeval/) { $conditionok=1; last; }
                                }
+                               elsif ($conditiontype eq 'UA') {
+                                       if ($Debug) { debug(" Check condition '$conditiontype' must contain '$conditiontypeval' in $field[$pos_ua]",5); }
+                                       if ($field[$pos_ua] =~ m/$conditiontypeval/) { $conditionok=1; last; }
+                               }
+                               elsif ($conditiontype eq 'HOST') {\r
+                                       if ($Debug) { debug(" Check condition '$conditiontype' must contain '$conditiontypeval' in $field[$pos_host]",5); }\r
+                                       if ($HostResolved =~ m/$conditiontypeval/) { $conditionok=1; last; }\r
+                               }\r
                                else { error("Wrong value of parameter ExtraSectionCondition$extranum"); }
                        }
                        if (! $conditionok && @{$ExtraConditionType[$extranum]}) { next; }      # End for this section
@@ -6419,6 +6427,12 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat
                                elsif ($rowkeytype eq 'REFERER') {
                                        if ($field[$pos_referer] =~ m/$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
                                }
+                               elsif ($rowkeytype eq 'UA') {
+                                       if ($field[$pos_ua] =~ m/$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
+                               }
+                               elsif ($rowkeytype eq 'HOST') {\r
+                                       if ($HostResolved =~ m/$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }\r
+                               }\r
                                else { error("Wrong value of parameter ExtraSectionFirstColumnValues$extranum"); }
                        }
                        if (! $rowkeyok) { next; }      # End for this section