Tags:
statistics3Add my vote for this tag create new tag
, view all tags

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

Plugin Author: TWiki:Main.StephaneLenclud
Copyright: © 2006-2007, TWiki:Main.StephaneLenclud
© 2008-2011 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2011-05-03
Change History:  
2011-05-03: TWikibug:Item6701: Move settings to configure; doc improvements -- TWiki:Main.PeterThoeny
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, TWiki:Plugins.PageStatsPlugin, TWiki:Plugins.CounterPlugin

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 AccessStatsPlugin.md5 r5 r4 r3 r2 r1 manage 0.2 K 2011-05-03 - 07:24 PeterThoeny  
Compressed Zip archivetgz AccessStatsPlugin.tgz r5 r4 r3 r2 r1 manage 6.5 K 2011-05-03 - 07:24 PeterThoeny  
Compressed Zip archivezip AccessStatsPlugin.zip r8 r7 r6 r5 r4 manage 8.5 K 2011-05-03 - 07:24 PeterThoeny  
Unknown file formatEXT AccessStatsPlugin_installer r5 r4 r3 r2 r1 manage 3.4 K 2011-05-03 - 07:24 PeterThoeny  
Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r18 - 2013-10-16 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.