]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
You can use a particular not used field in your log file to build
authoreldy <>
Wed, 14 Jul 2004 16:01:44 +0000 (16:01 +0000)
committereldy <>
Wed, 14 Jul 2004 16:01:44 +0000 (16:01 +0000)
a personalized report with the ExtraSection feature. Just use a personalized
log format and use the tag %extraX (where X is a number) to name field you
want to use, then, in ExtraSection parmaters, you can use extraX to tell
wich info to use to extract data for building the chart.

docs/awstats_changelog.txt
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index 6ba7252e1c2644c80f0dea5336452d4eb006e975..af8036c1709baa896b2d10378cd370a4c712831b 100644 (file)
@@ -20,6 +20,11 @@ in default distrib. You can download it from AWStats web site).
 in mode "NewLine". No need to find a more recent record for this. This\r
 means the NotSortedRecordTolerance works even between end and start\r
 of updates.\r
+- You can use a particular not used field in your log file to build\r
+a personalized report with the ExtraSection feature. Just use a personalized\r
+log format and use the tag %extraX (where X is a number) to name field you\r
+want to use, then, in ExtraSection parmaters, you can use extraX to tell\r
+wich info to use to extract data for building the chart.\r
 \r
 Fixes:\r
 - Fix not recognized %time3 tag in LogFormat. This tag allows to process\r
index 8038761881bf67f908cf74a7b3ba9ee5a3ba8eb4..1a2ab16cb616457e95ab5bc3e151077b11db2a11 100644 (file)
@@ -1,4 +1,4 @@
-# AWSTATS CONFIGURE FILE 6.0
+# AWSTATS CONFIGURE FILE 6.2
 #-----------------------------------------------------------------------------
 # Copy this file into awstats.www.mydomain.conf and edit this new config file
 # to setup AWStats (See documentation in docs/ directory).
@@ -103,9 +103,12 @@ LogType=W
 #                     contains data of several virtual web servers. AWStats
 #                     will discard records not in SiteDomain nor HostAliases
 #   %cluster          If log file is provided from several computers (merged by
-#                     logresolvemerge.pl), this tag define field of cluster id.
+#                     logresolvemerge.pl), use this to define cluster id field.
+#   %extraX           Another field that you plan to use for building a
+#                     personalized report with ExtraSection feature (See later).
 #   If your log format has some fields not included in this list, use:
-#   %other            Means another field not used
+#   %other            Means another not used field
+#   %otherquot        Means another not used double quoted field
 #
 # Examples for Apache combined logs (following two examples are equivalent):
 # LogFormat = 1
@@ -1311,11 +1314,11 @@ color_x="C1B2E2"                                # Background color for number of exit pages (Default = "C1B2
 # ExtraSectionCodeFilterX is list of codes the record code field must match.
 #   Put an empty string for no test on code.
 # ExtraSectionConditionX are conditions you can use to count or not the hit,
-#   Use one of the field condition (URL,QUERY_STRING,REFERER,UA,HOST)
+#   Use one of the field condition (URL,QUERY_STRING,REFERER,UA,HOST,extraX)
 #   and a regex 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 in which 
-#   field to extract value from (URL,QUERY_STRING,REFERER,UA,HOST)
+# ExtraSectionFirstColumnValuesX is a string to tell AWStats which field to
+#   extract value from (URL,QUERY_STRING,REFERER,UA,HOST,extraX)
 #   and how to extract the value (using regex syntax). Each different value
 #   found will appear in first column of report on a different row. Be sure
 #   that list of different possible values will not grow indefinitely.
index cb21fd8f84bc6f96e113a9a58691d8c7d65c5f68..273a46ddd504490c82d3bb2b37c36aff4e4ecfba 100644 (file)
@@ -60,7 +60,7 @@ $FrameName $Center $FileConfig $FileSuffix $Host $DayRequired $MonthRequired $Ye
 $QueryString $SiteConfig $StaticLinks $PageCode $PageDir $PerlParsingFormat $UserAgent
 $pos_vh $pos_host $pos_logname $pos_date $pos_tz $pos_method $pos_url $pos_code $pos_size
 $pos_referer $pos_agent $pos_query $pos_gzipin $pos_gzipout $pos_compratio
-$pos_cluster $pos_emails $pos_emailr $pos_hostr
+$pos_cluster $pos_emails $pos_emailr $pos_hostr @pos_extra
 /;
 $DIR=$PROG=$Extension='';
 $Debug = $ShowSteps = 0;
@@ -81,6 +81,7 @@ $QueryString, $SiteConfig, $StaticLinks, $PageCode, $PageDir, $PerlParsingFormat
 $pos_vh = $pos_host = $pos_logname = $pos_date = $pos_tz = $pos_method = $pos_url = $pos_code = $pos_size = -1;
 $pos_referer = $pos_agent = $pos_query = $pos_gzipin = $pos_gzipout = $pos_compratio = -1;
 $pos_cluster = $pos_emails = $pos_emailr = $pos_hostr = -1;
+@pos_extra=();
 # ----- Plugins variable -----
 use vars qw/ %PluginsLoaded $PluginDir $AtLeastOneSectionPlugin /;
 %PluginsLoaded=();
@@ -5052,6 +5053,11 @@ sub DefinePerlParsingFormat {
                                        $PerlParsingFormat .= "([^$LogSeparatorWithoutStar]+)";
                                }
                        }
+                       # Extra tag
+                       elsif ($f =~ /%extra(\d+)$/) {
+                               $pos_extra[$1] = $i; $i++; push @fieldlib, "extra$1";
+                               $PerlParsingFormat .= "([^$LogSeparatorWithoutStar]+)";
+                       }
                        # Other tag
                        elsif ($f =~ /%other$/) {
                                $PerlParsingFormat .= "[^$LogSeparatorWithoutStar]+";
@@ -6229,7 +6235,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
                        foreach (split(/&/,$standalonequery)) {
                                if ($_ =~ /^screen=(\d+)x(\d+)/i)       { $foundparam++; $_screensize_h{"$1x$2"}++; next; }
                                #if ($_ =~ /cdi=(\d+)/i)                        { $foundparam++; $_screendepth_h{"$1"}++; next; }
-                               if ($_ =~ /^nojs=(\w+)/i)                       { $foundparam++; if ($1 eq 'y')    { $_misc_h{"JavaScriptDisabled"}++; } next; }
+                               if ($_ =~ /^nojs=(\w+)/i)                       { $foundparam++; if ($1 eq 'y')    { $_misc_h{"JavascriptDisabled"}++; } next; }
                                if ($_ =~ /^java=(\w+)/i)                       { $foundparam++; if ($1 eq 'true') { $_misc_h{"JavaEnabled"}++; } next; }
                                if ($_ =~ /^shk=(\w+)/i)                        { $foundparam++; if ($1 eq 'y')    { $_misc_h{"DirectorSupport"}++; } next; }
                                if ($_ =~ /^fla=(\w+)/i)                        { $foundparam++; if ($1 eq 'y')    { $_misc_h{"FlashSupport"}++; } next; }
@@ -6960,6 +6966,10 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat
                                        if ($Debug) { debug("  Check condition '$conditiontype' must contain '$conditiontypeval' in '$field[$pos_host]'",5); }
                                        if ($HostResolved =~ /$conditiontypeval/) { $conditionok=1; last; }
                                }
+                               elsif ($conditiontype =~ /extra(\d+)/i) {
+                                       if ($Debug) { debug("  Check condition '$conditiontype' must contain '$conditiontypeval' in '$field[$pos_extra[$1]]'",5); }
+                                       if ($field[$pos_extra[$1]] =~ /$conditiontypeval/) { $conditionok=1; last; }
+                }
                                else { error("Wrong value of parameter ExtraSectionCondition$extranum"); }
                        }
                        if (! $conditionok && @{$ExtraConditionType[$extranum]}) { next; }      # End for this section
@@ -6987,6 +6997,9 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
                                elsif ($rowkeytype eq 'HOST') {
                                        if ($HostResolved =~ /$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
                                }
+                               elsif ($rowkeytype =~ /extra(\d+)/i) {
+                                       if ($field[$pos_extra[$1]] =~ /$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
+                               }
                                else { error("Wrong value of parameter ExtraSectionFirstColumnValues$extranum"); }
                        }
                        if (! $rowkeyok) { next; }      # End for this section
@@ -7003,7 +7016,7 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
                        if (scalar keys %{'_section_' . $extranum . '_h'} > $ExtraTrackedRowsLimit) {
                                error(<<END_ERROR_TEXT);
 The number of values found for extra section $extranum has grown too large.
-In order prevent awstats from using an excessive amount of memory, the number
+In order to prevent awstats from using an excessive amount of memory, the number
 of values is currently limited to $ExtraTrackedRowsLimit. Perhaps you should consider
 revising extract parameters for extra section $extranum. If you are certain you
 want to track such a large data set, you can increase the limit by setting
@@ -9862,7 +9875,7 @@ if (scalar keys %HTMLOutput) {
                        print "<th width=\"100\">&nbsp;</th>";
                        print "<th width=\"100\">&nbsp;</th>";
                        print "</tr>\n";
-                       my %label=('AddToFavourites'=>$Message[137],'JavaScriptDisabled'=>$Message[168],'JavaEnabled'=>$Message[140],'DirectorSupport'=>$Message[141],
+                       my %label=('AddToFavourites'=>$Message[137],'JavascriptDisabled'=>$Message[168],'JavaEnabled'=>$Message[140],'DirectorSupport'=>$Message[141],
                        'FlashSupport'=>$Message[142],'RealPlayerSupport'=>$Message[143],'QuickTimeSupport'=>$Message[144],
                        'WindowsMediaPlayerSupport'=>$Message[145],'PDFSupport'=>$Message[146]);
                        foreach my $key (@MiscListOrder) {