69. Peastat

Peastat is a simple, free, 'live' web stats analyser. Peastat works differently to other web stats tools: it looks at the last chunk of your log file to create real-time summaries of recent user activity. What you lose in trend analysis - which you're probably already getting from Analog/Webalizer/AWStats/Google Analysis - you gain in focus on what your users are doing right now.

Peastat Features

Simple - application, instructions and configuration are included in one file. No database required. Free and open source Atom 1.0 support - monitor recent activity through your newsreader Referrer tracking, with search engine query analysis Simple path analysis Cached DNS lookups No need for JavaScript bugs or PHP includes

System Requirements

Python 2.1+ available as CGI

Read access to your log files, in Apache extended/combined format

Linux/BSD/OS X hosts typically support both requirements.


Configure the 'logfile' and 'rooturl' values Upload pea.py somewhere it can be executed on your web server (e.g. your cgi-bin) Make pea.py executable (set its permissions to 755)


Point your browser to http://yoursite/cgi-bin/pea.py Point your Atom-enabled newsreader to http://yoursite/cgi-bin/pea.py?atom=true

Example Peastat for throwingbeans.org

Peastat for throwingbeans.org


Peastat 0.2 can be downloaded here.

Version history

0.2, 18th December, 2005

Stop rewarding referrer spam Simple AJAX library for future use Handle user agents whose names include escaped quotes Recognise Yahoo searches Handle URLs with ampersands correctly Time execution of the overview screen Don't break on fake referrers Improve error handling on tailing log file Distinguish links to visited IP details pages with CSS Rename from peastat.py to pea.py

0.1, 11th September, 2005

First public release


The name of my log file changes periodically - how do I tell Peastat where to find it? Format a string for the current date with Python's time module, and insert it in the logfile setting: year_slash_month = time.strftime('%Y/%m') # e.g. '2005/12' logfile = "/var/log/apache/" + year_slash_month + "/access_log" How do I tell Peastat to ignore referrals from search engines? Currently the only way to do this is to edit the ignorelines pattern. For example: ignorelines = re.compile('(google)|(yahoo)\.co').search


Contributions: Martin Stricker Philippe Normand Juanjo Navarro Mínguez Suggestions and error reports: Nick Burch Mark Lacas James Claiborne Louis A Bustamante Brian F. Opitz Michael Prewitt Alex Taylor

Help, bug reports, suggestions

Email tomdyson at spamcop dot net

© Tom Dyson 2007

About | Contact | Search | Archives