pdbtool

Langue: en

Autres versions - même langue

Version: 11/30/2009 (fedora - 01/12/10)

Autres sections - même nom

Section: 1 (Commandes utilisateur)

NAME

pdbtool - An application to test and convert syslog-ng pattern database rules

SYNOPSIS

pdbtool [command] [options]

DESCRIPTION

This manual page is only an abstract; for the complete documentation of syslog-ng and pdbtool, see The syslog-ng Administrator Guide [1].

The syslog-ng application can match the contents of the log messages to a database of predefined message patterns (also called patterndb). By comparing the messages to the known patterns, syslog-ng is able to identify the exact type of the messages, tag the messages, and sort them into message classes. The message classes can be used to classify the type of the event described in the log message. The functionality of the pattern database is similar to that of the logcheck project, but the syslog-ng approach is faster, scales better, and is much easier to maintain compared to the regular expressions of logcheck.

The pdbtool application is a utility that can be used to:

*test message patterns;
*convert an older pattern database to the latest database format;
*merge pattern databases into a single file;
*dump the RADIX tree built from the pattern database (or a part of it) to explore how the pattern matching works.

THE MATCH COMMAND

match [options]
Use the match command to test the rules in a pattern database. The command tries to match the specified message against the patterns of the database, evaluates the parsers of the pattern, and also displays which part of the message was parsed successfully. The command returns with a 0 (success) or 1 (no match) return code and displays the following information:
*the class assigned to the message (e.g., system, violation, etc.),
*the ID of the rule that matched the message, and
*the values of the parsers (if there were parsers in the matching pattern).

The match command has the following options:

--color-out or -c

Color the terminal output to highlight the part of the message that was successfully parsed.

--debug-pattern or -D

Print debugging information about the pattern matching.

--message or -M

The text of the log message to match (only the $MESSAGE part without the syslog headers).

--pdb or -p

Name of the pattern database file to use.

--program or -P

Name of the program to use, as contained in the $PROGRAM part of the syslog message.

Example:

 pdbtool match -p patterndb.xml -P sshd -M "Accepted publickey for myuser from 127.0.0.1 port 59357 ssh2"
 

THE MERGE COMMAND

merge [options]
Use the merge command to combine separate pattern database files into a single file (pattern databases are usually stored in separate files per applications to simplify maintenance). If a file uses an older database format, it is automatically updated to the latest format (V3). See the The syslog-ng Administrator Guide [1] for details on the different pattern database versions.

--directory or -D

The directory that contains the pattern database XML files to be merged.

--pdb or -p

Name of the output pattern database file.

Example:

 pdbtool merge --directory /home/me/mypatterns/  --pdb /var/lib/syslog-ng/patterndb.xml
 

Currently it is not possible to convert a file without merging, so if you only want to convert an older pattern database file to the latest format, you have to copy it into an empty directory.

THE MERGE COMMAND

dump [options]
Display the RADIX tree built from the patterns. This shows how are the patterns represented in syslog-ng and it might also help to track down pattern-matching problems. The dump utility can dump the tree used for matching the PROGRAM or the MSG parts.

--pdb or -p

Name of the pattern database file to use.

--program or -P

Displays the RADIX tree built from the patterns belonging to the $PROGRAM application.

--program-tree or -T

Display the $PROGRAM tree.

Example and sample output:

 pdbtool dump -p patterndb.xml  -P 'sshd'
 
 'p'
    'assword for'
      @QSTRING:@
        'from'
         @QSTRING:@
           'port '
             @NUMBER:@ rule_id='fc49054e-75fd-11dd-9bba-001e6806451b'
               ' ssh' rule_id='fc55cf86-75fd-11dd-9bba-001e6806451b'
                  '2' rule_id='fc4b7982-75fd-11dd-9bba-001e6806451b'
     'ublickey for'
       @QSTRING:@
         'from'
          @QSTRING:@
            'port '
              @NUMBER:@ rule_id='fc4d377c-75fd-11dd-9bba-001e6806451b'
                ' ssh' rule_id='fc5441ac-75fd-11dd-9bba-001e6806451b'
                   '2' rule_id='fc44a9fe-75fd-11dd-9bba-001e6806451b'
               
 

FILES

/opt/syslog-ng/etc/syslog-ng/

/opt/syslog-ng/etc/syslog-ng/syslog-ng.conf

SEE ALSO

The syslog-ng Administrator Guide [1]

syslog-ng.conf(5)

syslog-ng(8)

If you experience any problems or need help with syslog-ng, visit the syslog-ng mailing list [2]

For news and notifications about the documentation of syslog-ng, visit the BalaBit Documentation Blog[3].

AUTHOR

This manual page was written by the BalaBit Documentation Team <documentation@balabit.com>.

Copyright © 2000-2009 BalaBit IT Security Ltd. Published under the Creative Commons Attribution-Noncommercial-No Derivative Works (by-nc-nd) 3.0 license. See http://creativecommons.org/ for details. The latest version is always available at http://www.balabit.com/support/documentation.

NOTES

1.


          The syslog-ng Administrator Guide
        

http://www.balabit.com/support/documentation/
2.


          syslog-ng mailing list
        

https://lists.balabit.hu/mailman/listinfo/syslog-ng
3.
BalaBit Documentation Blog
http://robert.blogs.balabit.com