From: bcogit Date: Tue, 21 Jun 2016 14:51:19 +0000 (+0200) Subject: Update awstats.pl X-Git-Tag: AWSTATS_7_6~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F31%2Fhead;p=thirdparty%2FAWStats.git Update awstats.pl I have log (from AWS load balancer) that have an ip syntaxe with port (ex: 54.32.12.1:60321) The change is only to cut the port and only keep the ip, so the geoip tools could work correctly then. I'm not a perl expert, but it work on my installation with my data. --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index bf7fadcd..f7dfa4ad 100755 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -19200,6 +19200,11 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) my $HostResolved = '' ; # HostResolved will be defined in next paragraf if countedtraffic is true + if( $Host =~ /^([^:]+):[0-9]+$/ ){ # Host may sometimes have an ip:port syntax (ex: 54.32.12.12:60321) + $Host = $1; + } + + if ( !$countedtraffic || $countedtraffic == 6) { my $ip = 0; if ($DNSLookup) { # DNS lookup is 1 or 2