Koozali.org: home of the SME Server

AWStats refuses to ignore local hits

Offline allsorts

  • *
  • 38
  • +0/-0
AWStats refuses to ignore local hits
« on: July 30, 2011, 01:39:49 PM »
Hi,

Just installed the Dungog AWStats package but can't get it to ignore local hits. I've tried almost every combination of the three ignore settings in the Web Statistics server manager panel to no avail.

I've searched the bug tracker and forums and only found old messages saying that others have the same problem but no resolution. In fact it only appears to see local hits not remote ones.  B-)

Anyone got any ideas?
Cheers
Dave.

Offline allsorts

  • *
  • 38
  • +0/-0
Re: AWStats refuses to ignore local hits
« Reply #1 on: July 30, 2011, 10:15:24 PM »
Been diggin'

Looks like there has been a change in the config file for AWStats. <dots> no longer need to be backslash escaped so the SkipHosts line can be, for example:

SkipHosts="192.168.1. 127.0.0.1"

That isn't the whole story though. Line 1984 in awstats.pl  appends a $ when in constructs the (?i-xsm:... used for the skip matching. This also stops the skip match working. Why is beyond my regex/perl knowledge, all I  know is (?i-xsm:^192\.168\.1\.) works but (?i-xsm:^192\.168\.1\.$) doesn't.

Now the awstats.conf file is built via the SME server template system so that needs to be changed other wise any edits made will be lost when the templates are used (ie after a config change via the Server Manager panel). There are a number of places where <dots> are backslash escaped either by a regex or just hard coded. Similarly there are number of places where that $ is appended in awstats.pl but I don't know what they do, so I've only taken out the one on line 1984.
« Last Edit: July 30, 2011, 10:53:50 PM by allsorts »
Cheers
Dave.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: AWStats refuses to ignore local hits
« Reply #2 on: July 31, 2011, 12:18:08 AM »
The $ sign is a regular expression anchor and ties the regular expression one's trying to match to the end of the haystack, see also http://www.regular-expressions.info/anchors.html
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline allsorts

  • *
  • 38
  • +0/-0
Re: AWStats refuses to ignore local hits
« Reply #3 on: August 02, 2011, 01:02:16 PM »
Thanks I'm going to have to wake the brain up about the implications of using the start and fiinsh anchors on the same match. AWStats does it alot for other inclusion/exclusion matching. Wonder if  the * wildcard in the config would enable the match to work with the ^ and $ anchours?
Cheers
Dave.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: AWStats refuses to ignore local hits
« Reply #4 on: August 02, 2011, 01:04:13 PM »
Wonder if  the * wildcard in the config would enable the match to work with the ^ and $ anchours?
It should.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline allsorts

  • *
  • 38
  • +0/-0
Re: AWStats refuses to ignore local hits
« Reply #5 on: August 02, 2011, 05:27:28 PM »
Well it sort of does but you can't put the * in the config as awstats.pl uses quotemeta on the supplied input when in generates the (?i-xsm:...) string. This escapes the * of course and stops it being a wild card.

If I alter the appended lone "$" in awstats.pl to ".*$" it does work. As similar bits of code are used in several place in awstats.pl to process other includ/exclude matches one assumes they are all broken as well. Think I need to wander over to awstats on sourceforge and file a bug report.
Cheers
Dave.