r5 - 20 Feb 2006 - 20:23:30 - StephaneLenclud?You are here: TWiki >  TWiki Web  > AccessStatsPlugin
Tags:
create new tag
, view all tags

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)
    • Set DEBUG = 0

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.
  • Test if the installation was successful:
    • This page hit count: 1

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

Plugin Author: TWiki:Main.StephaneLenclud
Copyright: © 2006, TWiki:Main.StephaneLenclud
License: GPL (GNU General Public License)
Plugin Version: 21 Feb 2006 (V1.001)
Change History:  
21 Feb 2006: Supports gz archived apache log file
20 Feb 2006: Now supports web, topic and attachment parameter
18 Feb 2006: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: Compress::Zlib
Other Dependencies: none
Perl Version: 5.005
Benchmarks: GoodStyle nn%, FormattedSearch nn%, AccessStatsPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/AccessStatsPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/AccessStatsPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/AccessStatsPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences, PageStatsPlugin?, CounterPlugin?

-- TWiki:Main.StephaneLenclud - 21 Feb 2006

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.AccessStatsPlugin