Motivation

Crafting regular expressions can be a daunting task, one that puts off potential contributors, scares users, and discourages package maintainers from including their own patterns, (or results in them doing it badly).

When such macros are implemented, it will be easy to update, for example, the regex for a hostname. The changes will propigate to all of the rules. This will save a lot of work in the end.

Most of the rules used in Logcheck contain a great deal of repetition, such as the patterns used to match an IP address, hostnames, usernames, the time stamp and pid added by syslog, and many more. Amidst all of this repetition is an opportunity to automate a portion of the writing task using a simple meta-pattern syntax, replacing long, tedious regex with easy to remember "tags". This page is here to coordinate an experiment to create a tool that does just that.

Requirements

Implementation Thoughts

Matched "$SYSLOG sshd\[$PID\]: Illegal user $USERNAME from $IP" 128 times:
 DATE PID     USERNAME    IP
 ...  1234    admin       1.2.3.4
[...]

Macro Syntax

What syntax are we using for the macros?

Miscellanea

  1. I've expanded on my original proof-of-concept, (http://people.debian.org/~eevans), with something that works similarly but uses Template Toolkit. You can pull a copy using darcs, run "darcs get http://sym-link.com/darcs/logcheck".

  2. I'm not sure we really want to go this direction, but the pre-processor *could* optionally tighten rules upon generation to the particular machine on which it is running. Basically what I'm talking about is dynamic macro substiution. For example, $fqdn would expand to say "foo.logcheck.org"

LogcheckTemplateSystem (last edited 2009-08-21 03:07:18 by localhost)