Tuesday, December 22, 2009

pdbtool stylists wanted

I have just pushed to my syslog-ng 3.1 git repo some patches to add more detailed debugging/troubleshooting capabilities to patterndb through pdbtool match. Now you can easily see how your patterns matched a given message, which part of the message was matched by literal part of the pattern and which by a parser. All this new feature with a wonderful colorized output if requested, though the colors are still bit ugly...

Up to now the easiest way of creating patterns was to do trial & error sequence and try to figure out which part of the pattern was broken. Now you can exactly see where the matching stopped. As one picture is more verbose than hundreds of words, here is some screenshoot of pdbtool match.

The patterndb.xml in use:













A successful match:













A failed match:






It is also possible to output the match in parse-able format to be used in scripts or as a backend of some pattern authoring tool. Here is the output for that:









I am still not sure about the colored output nor about the machine parse-able output format, so any feedback, comment, idea or suggestion is very much appreciated.

You can grab the latest source code from my git repo.

Happy matching!

0 comments:

Post a Comment