Thanks moo for the thinking about the log analyser code. I develop it for a customer that agreed to make it Open Source so it is
available at sourceforge, with some docs too on what the objects do. The name of the analyser is a bit weird, because I didn't want to put it any of the CPAN namespaces. It's in beta, with a lot of out of date comments and other weird stuff; it's probably not of any use for others yet.
Regarding making the log analyser general, I only intended it for web server logs, however it is built to make statistics of any log file. The only assumption about what kind of log it should parse is that it should consist of lines (Monday correction: it assumes there is a date pattern too of a particular format). The line assumption could easily be taken away by changing the LogFile object. Categories are defined as a pattern and a title for the category, so you should be able to match anyting that is, er, matchable. You can also put in some code for each category (e.g. the Query module unescapes the query string, before storing statistics). Next step will be to put in a slot for a private data structure that can be used by an object to have a memory between lines, for recording sessions.
A lot of other stuff is hard coded, e.g. HTML.
/jeorgen
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.