Logsplit
A Log File Splitter
This is a small regex-based logfile splitter born out of client requirements that each hosted domain has it's own awstats report page.
Initially we used awstats' ability to read logs from a pipe, thereby allowing awstats to extract the relevant lines from a common log file using grep. This works fine if you have a small number of domains, but one of our clients are now hosting over 200 domains on a zope/plone with a squid accelerator setup. This means that now we grep through a fairly large log file 200 times whenever we update stats.
Logsplit is a python program. It reads logs from stdin and splits them to separate log files using regexes from a configuration file. It can be used directly with later versions of squid, earlier versions do not include support for logging to a pipe. Apache has had support for logging to a pipe for a long time though.
It is available from svn here.







