AccessStatsPlugin
Show hit count for topics and attachments by parsing Apache access log files
Introduction
The AccessStatsPlugin provide statistics by parsing the Apache access log files. It gives the hit count for attachments or topics. One can also use the default parameter to count the number of line matching a regexp in the access log files. This is most useful if you want to monitor access to your web server.
Syntax Rules
Adds the following tag:
-
%ACCESSSTATS% - displays the number of successful access to the current topic.
Parameters:
-
"" - specify a regexp to search the access log file with
-
web="" - specify web
-
topic="" - specify topic
-
attachment="" - specify attachment
Examples
-
%ACCESSSTATS{"GET\s.+\s200\s"}% - count the number of successful GET request.
-
%ACCESSSTATS{web="MyWeb" topic="MyTopic"}% - count the numer of successful GET request for specified web abd topic.
-
%ACCESSSTATS{web="MyWeb" topic="MyTopic" attachment="MyAttachment"}% - count the numer of successful GET request for specified attachment on specified web and topic.
-
%ACCESSSTATS{attachment="MyAttachment"}% - count the number of successful GET request for specified attachment in current topic.
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
- For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.
- Or, follow these manual installation steps:
- Download the ZIP file from the Plugins home (see below).
- Unzip
AccessStatsPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/AccessStatsPlugin.txt | Plugin topic |
lib/TWiki/Plugins/AccessStatsPlugin.pm | Plugin Perl module |
- Set the ownership of the extracted directories and files to the webserver user.
- Plugin configuration and testing:
- Run the configure script, enable the plugin in the Plugins section, and customize the following settings of AccessStatsPlugin in the Extensions section:
{Plugins}{AccessStatsPlugin}{Debug} - default 0
{Plugins}{AccessStatsPlugin}{LogFileName} - default 'access_log'
{Plugins}{AccessStatsPlugin}{LogDirectory} - default '/var/logs/httpd'
{Plugins}{AccessStatsPlugin}{EnableRegexSearch} - default 0
- Make sure the CGI user (www-data) has read permission to the log file.
- Test if the installation was successful: See Usage Example above
- Test if the installation was successful:
- This page hit count: %ACCESSSTATS%
Plugin Info
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Show hit count for topics and attachments by parsing Apache access log files
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences,
TWiki:Plugins.PageStatsPlugin
,
TWiki:Plugins.CounterPlugin