AccessStatsPlugin
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.
Attributes:
- default - 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 Settings
Plugin settings are stored as preferences variables. To reference
a plugin setting write
%<plugin>_<setting>%, i.e.
%EMPTYPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Provides statistics by parsing access log file, such as Apache access log
- Debug plugin: (See output in
data/debug.txt)
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.
- Download the ZIP file from the Plugin web (see below)
- Unzip
AccessStatsPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/AccessStatsPlugin.txt | Plugin topic |
data/TWiki/AccessStatsPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/AccessStatsPlugin.pm | Plugin Perl module |
- Configure the Plugin:
- TWiki 4.0 and up: Run the configure script to enable the Plugin
- Change the Plugin settings as needed
- In
lib/TWiki/Plugins/AccessStatsPlugin.pm set $accessLogFileName and $accessLogDirectory according to your local settings.
- Make sure the CGI user (www-data) has read permission to the log file.
- Test if the installation was successful:
- This page hit count: %ACCESSSTATS%
Plugin Release Instructions
To release a new version from an installation on a linux machine just execute the following command from your twiki installation directory:
find . -name "AccessStatsPlugin.*" -print | zip AccessStatsPlugin.zip -@
Plugin Info
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences,
PageStatsPlugin? ,
CounterPlugin?
--
TWiki:Main.StephaneLenclud - 21 Feb 2006