From bfe127edcd601f950edbb7284c34d3d64383cede Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Dec 2013 18:25:09 +0100 Subject: [PATCH] Support for ModCloudFlareIIS. --- wwwroot/cgi-bin/awstats.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 98f3e6bd..e75ceab8 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -18411,6 +18411,12 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' ) 4 ); } + # Check if there's a CloudFlare Visitor IP in the query string + # If it does, replace the ip + if ( $pos_query >= 0 && $field[$pos_query] && $field[$pos_query] =~ /\[CloudFlare_Visitor_IP[:](\d+[.]\d+[.]\d+[.]\d+)\]/ ) { + $field[$pos_host] = "$1"; + } + # We found a new line #---------------------------------------- if ( $timerecord > $LastLine ) { -- 2.47.3