You are here: TWiki> Plugins Web>AccessStatsPlugin (2008-12-12, SopanShewale)
Tags:
statistics2Add my vote for this tag 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.
  • 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

Plugin Author: TWiki:Main.StephaneLenclud
Copyright: © 2006-2007, TWiki:Main.StephaneLenclud
License: GPL (GNU General Public License)
Plugin Version: 9 Apr 2007 (V1.002)
Change History:  
9 Apr 2007 Fixing issue with unzipped files like access.log.n not being parsed.
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

Topic attachments
I Attachment Action Size Date Who Comment
elsemd5 AccessStatsPlugin.md5 manage 0.2 K 2008-12-12 - 11:00 SopanShewale checksum file , Uploaded as a part of Release Process
ziptgz AccessStatsPlugin.tgz manage 6.8 K 2008-12-12 - 11:00 SopanShewale See AccessStatsPlugin for details. Untar and run the installer script, Uploaded as a part of Release Process
zipzip AccessStatsPlugin.zip manage 8.4 K 2008-12-12 - 11:00 SopanShewale See AccessStatsPlugin for details. Unzip and run the installer script , Uploaded as a part of Release Process
elseEXT AccessStatsPlugin_installer manage 3.4 K 2008-12-12 - 11:00 SopanShewale Installer Script, Uploaded as a part of Release Process
Topic revision: r14 - 2008-12-12 - 11:00:29 - SopanShewale
 

Plugins

share: Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon
Twiki, Inc.
This site is powered by the TWiki collaboration platform
Ideas, requests, problems regarding TWiki? Send feedback
Copyright © 1999-2010 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.