<br># ExtraSectionCodeFilterX is list of codes the record code field must match.
<br># Put an empty string for no test on code.
<br># ExtraSectionConditionX are conditions you can use to count or not the hit,
-<br># Use one of the field condition (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,
-<br># HOST,extraX) and a regex to match, after a coma. Use "||" for "OR".
+<br># Use one of the field condition
+<br># (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOSTINLOG,HOST,VHOST,extraX)
+<br># and a regex to match, after a coma. Use "||" for "OR".
<br># ExtraSectionFirstColumnTitleX is the first column title of the chart.
<br># ExtraSectionFirstColumnValuesX is a string to tell AWStats which field to
-<br># extract value from (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,extraX)
+<br># extract value from
+<br># (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOSTINLOG,HOST,VHOST,extraX)
<br># and how to extract the value (using regex syntax). Each different value
<br># found will appear in first column of report on a different row. Be sure
<br># that list of different possible values will not grow indefinitely.
# dramatically AWStats update process speed. Do not use on large web sites.
# Note: Reverse DNS lookup is done on IPv4 only (Enable ipv6 plugin for IPv6).
# Note: Result of DNS Lookup can be used to build the Country report. However
-# it is highly recommanded to enable the plugin 'geoipfree' or 'geoip' to
+# it is highly recommanded to enable the plugin 'geoip' or 'geoipfree' to
# have an accurate Country report with no need of DNS Lookup.
# Possible values:
# 0 - No DNS Lookup
# This plugin gives AWStats capability to make reverse DNS lookup on IPv6
# addresses.
# Note: If you are interested in having country report, you should use the
-# geoipfree or geoip plugin instead of enabled reverse DNS lookup.
+# geoip or geoipfree plugin instead of enabled reverse DNS lookup.
#
#LoadPlugin="ipv6"
# Country chart is built from an Internet IP-Country database.
# This plugin is useless for intranet only log files.
# Note: You must choose between using this plugin (need Perl Geo::IP module
-# from Maxmind, database more up to date) or the GeoIPfree plugin (need
-# Perl Geo::IPfree module, database less up to date).
+# from Maxmind, database is free and up to date) or the GeoIPfree plugin
+# (need Perl Geo::IPfree module, database is free but not up to date).
+# There is two versions of Maxmind Country Database:
+# You can get a free version or purchase a license from Maxmind to get/use a more
+# accurate version including updates (http://www.maxmind.com/app/perl?rId=awstat)
# This plugin reduces AWStats speed of 8% !
#
#LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"
# Country chart is built from an Internet IP-Country database.
# This plugin is useless for intranet only log files.
# Note: You must choose between using this plugin (need Perl Geo::IPfree
-# module, database less up to date) or the GeoIP plugin (need Perl Geo::IP
-# module from Maxmind, database more up to date).
+# module, database is free but not up to date) or the GeoIP plugin (need
+# Perl Geo::IP module from Maxmind, database is also free and up to date).
# Note: Activestate provide a corrupted version of Geo::IPfree 0.2 Perl
# module, so install it from elsewhere (from www.cpan.org for example).
# This plugin reduces AWStats speed of 10% !
# Note: This plugin need Maxmind GeoIP Perl module AND the city database.
# Note: I get some problem with Maxmind Geo::IP Perl module with ActiveState
# on Windows but it works great on Linux with default Perl.
-# You need to purchase a license from Maxmind to get/use the City database.
+# There is two versions of Maxmind City Database:
+# You can get a free version or purchase a license from Maxmind to get/use a more
+# accurate version including updates (http://www.maxmind.com/app/perl?rId=awstat)
# This plugin reduces AWStats speed.
#
#LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /pathto/GeoIPCity.dat"
# 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,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,extraX)
+# (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOSTINLOG,HOST,VHOST,extraX)
# and a regex to match, after a coma. Use "||" for "OR".
# ExtraSectionFirstColumnTitleX is the first column title of the chart.
# ExtraSectionFirstColumnValuesX is a string to tell AWStats which field to
# extract value from
-# (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOST,VHOST,extraX)
+# (URL,URLWITHQUERY,QUERY_STRING,REFERER,UA,HOSTINLOG,HOST,VHOST,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.
$lastlinechecksum=$LastLineChecksum;
}
- if ($Debug) { debug(" Save_History [sectiontosave=$sectiontosave,year=$year,month=$month,lastlinenb=$lastlinenb,lastlineoffset=$lastlineoffset,lastlinechecksum=$lastlinechecksum]",1); }
+ if ($Debug) { debug(" Save_History [sectiontosave=$sectiontosave,year=$year,month=$month,breakdate=$breakdate,lastlinenb=$lastlinenb,lastlineoffset=$lastlineoffset,lastlinechecksum=$lastlinechecksum]",1); }
my $spacebar=" ";
my %keysinkeylist=();
# Do DNS lookup
#--------------
my $Host=$field[$pos_host];
- my $HostResolved='';
+ my $HostResolved=''; # HostResolved will be defined in next paragraf if countedtraffic is true
if (! $countedtraffic) {
my $ip=0;
$_cluster_k{$field[$pos_cluster]}+=int($field[$pos_size]); #Count accesses for page (kb)
}
+
# Analyze: Extra
#---------------
foreach my $extranum (1..@ExtraName-1) {
if ($Debug) { debug(" Check condition '$conditiontype' must contain '$conditiontypeval' in '$field[$pos_agent]'",5); }
if ($field[$pos_agent] =~ /$conditiontypeval/) { $conditionok=1; last; }
}
- elsif ($conditiontype eq 'HOST') {
+ elsif ($conditiontype eq 'HOSTINLOG') {
if ($Debug) { debug(" Check condition '$conditiontype' must contain '$conditiontypeval' in '$field[$pos_host]'",5); }
- if ($HostResolved =~ /$conditiontypeval/) { $conditionok=1; last; }
+ if ($field[$pos_host] =~ /$conditiontypeval/) { $conditionok=1; last; }
+ }
+ elsif ($conditiontype eq 'HOST') {
+ my $hosttouse=($HostResolved?$HostResolved:$Host);
+ if ($Debug) { debug(" Check condition '$conditiontype' must contain '$conditiontypeval' in '$hosttouse'",5); }
+ if ($hosttouse =~ /$conditiontypeval/) { $conditionok=1; last; }
}
elsif ($conditiontype eq 'VHOST') {
if ($Debug) { debug(" Check condision '$conditiontype' must contain '$conditiontypeval' in '$field[$pos_vh]'",5); }
elsif ($rowkeytype eq 'UA') {
if ($field[$pos_agent] =~ /$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
}
+ elsif ($rowkeytype eq 'HOSTINLOG') {
+ if ($field[$pos_host] =~ /$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
+ }
elsif ($rowkeytype eq 'HOST') {
- if ($HostResolved =~ /$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
+ my $hosttouse=($HostResolved?$HostResolved:$Host);
+ if ($hosttouse =~ /$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
}
elsif ($rowkeytype eq 'VHOST') {
if ($field[$pos_vh] =~ /$rowkeytypeval/) { $rowkeyval = "$1"; $rowkeyok = 1; last; }
}
else { error("Wrong value of parameter ExtraSectionFirstColumnValues$extranum"); }
}
- if (! $rowkeyok) { next; } # End for this section
- if ($Debug) { debug(" Key val was found: $rowkeyval",5); }
+ if (! $rowkeyok) { next; } # End for this section
+ if (! $rowkeyval) { $rowkeyval='Failed to extract key'; }
+ if ($Debug) { debug(" Key val found: $rowkeyval",5); }
# Apply function on $rowkeyval
if ($ExtraFirstColumnFunction[$extranum])