MDLog:/sysadmin

The Journal Of A Linux Sysadmin

HowTo Ignore Some Files/folders From Awstats Reports

| Comments

Awstats will consider as a page hit any entry from the log it processes. By default some file extensions (for regular image types and css/js) are excluded from what awstats will consider as a page:

1
NotPageList="css js class gif jpg jpeg png bmp ico"

(this is the default). All other file types will be counted as pages. Now, if we want to completely ignore some files, or even all the content of one folder from the awstats processing we can use the SkipFiles parameter. We might want to do this to ignore some frames, hidden pages, ajax calls, etc.

The SkipFiles parameter is by default empty, and in order to use it we have to add the appropriate config in our awstats.conf file.  For example to ignore a file called somefile.php we will add “/somefile.php”:

1
SkipFiles="/somefile.php"

while if we want to ignore all the pages in a folder called somefolder we will have to use a regex value like: _”REGEX[\/somefolder]”_ We can add several rules separated by spaces:

1
SkipFiles="/somefile.php REGEX[^\/somefolder]"

Note: this will be effective only for new updates; meaning existing data will not be affected by this (if really needed you will have to regenerate your stats to get rid of those pages in old stats).

Comments