pdbtool(1)
β¨ NAME β¨
pdbtool β The pdbtool manual page β an application to test and convert {{ site.product.short_name }} pattern database rules π
π¦ SYNOPSIS π¦
pdbtool [command] [options]
π DESCRIPTION π
okay so bestie, first thing you need to know: this manual page is only an abstract π like it's the vibe check, not the whole lore.
Here's the tea tho π The syslog-ng OSE 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 OSE 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 OSE approach is faster, scales better, and is much easier to maintain compared to the regular expressions of logcheck. no cap π
So what is the pdbtool application actually for? It's a utility that can be used to:
- test messages, or specific rules π§ͺ
- convert an older pattern database to the latest database format π
- merge pattern databases into a single file π«Ά
- automatically create pattern databases from a large amount of log messages β¨
- dump the RADIX tree built from the pattern database (or a part of it) to explore how the pattern matching works π³
π THE DICTIONARY COMMAND π
dictionary [options]
Lists every name-value pair that can be set by the rules of the pattern database. it's giving receipts π
--dump-tagor-Tβ List the tags instead of the names of the name-value pairs. π·οΈ--pdb <path-to-file>or-p <path-to-file>β Name of the pattern database file to use.--program <programname>or-P <programname>β List only the name-value pairs that can be set for the messages of the specified${PROGRAM}application.
π THE DUMP COMMAND π
dump [options]
Display the RADIX tree built from the patterns. This shows how are the patterns represented in syslog-ng OSE 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. it's literally a lil x-ray of your pattern matching π©»
--debugor-dβ Enable debug/diagnostic messages onstderr. π--pdbor-pβ Name of the pattern database file to use.--programor-Pβ Displays the RADIX tree built from the patterns belonging to the${PROGRAM}application.--program-treeor-Tβ Display the${PROGRAM}tree. π³--verboseor-vβ Enable verbose messages onstderr. π£οΈ
πΈ EXAMPLE:
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'
π 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 (that is,
system,violation, and so on), - 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-outor-cβ Color the terminal output to highlight the part of the message that was successfully parsed. π--debugor-dβ Enable debug/diagnostic messages onstderr.--debug-csvor-Cβ Print the debugging information returned by the--debug-patternoption as comma-separated values.--debug-patternor-Dβ Print debugging information about the pattern matching. See also the--debug-csvoption.--file=<filename-with-path>or-fβ Process the messages of the specified log file with the pattern database. This option allows to classify messages offline, and to apply the pattern database to already existing logfiles. To read the messages from the standard input (stdin), specify a hyphen (-) character instead of a filename. π--filter=<filter-expression>or-Fβ Print only messages matching the specified syslog-ng OSE filter expression.--messageor-Mβ The text of the log message to match (only theMESSAGEpart without the syslog headers).--pdbor-pβ Name of the pattern database file to use.--programor-Pβ Name of the program to use, as contained in thePROGRAMpart of the syslog message.--template=<template-expression>or-Tβ A syslog-ng OSE template expression that is used to format the output messages.--verboseor-vβ Enable verbose messages onstderr.
πΈ EXAMPLE: CHECK
The following command checks if the patterndb.xml file recognizes the Accepted publickey for myuser from 127.0.0.1 port 59357 ssh6 message:
pdbtool match -p patterndb.xml -P sshd -M "Accepted publickey for myuser from 127.0.0.1 port 59357 ssh6"
πΈ EXAMPLE: APPLY
The following example applies the sshd.pdb pattern database file to the log messages stored in the /var/log/messages file, and displays only the messages that received a useracct tag.
pdbtool match -p sshd.pdb \
βfile /var/log/messages \
βfilter βtags(βusracctβ);β
π§ 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 OSE Administrator Guide for details on the different pattern database versions. slay, all your pdb files, one big happy family π«Ά
--debugor-dβ Enable debug/diagnostic messages onstderr.--directoryor-Dβ The directory that contains the pattern database XML files to be merged.--globor-Gβ Specify filenames to be merged using a glob pattern, for example, using wildcards. For details on glob patterns, seeman glob. This pattern is applied only to the filenames, and not on directory names. π--pdbor-pβ Name of the output pattern database file.--recursiveor-rβ Merge files from subdirectories as well.--sortor-sβ Sort files into alphabetic order during the merge (first sort by filename, then by directory name).--verboseor-vβ Enable verbose messages onstderr.
πΈ EXAMPLE: MERGE
pdbtool merge --recursive --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. bestie don't fight it, just make the empty folder π
π THE PATTERNIZE COMMAND π
patternize [options]
Automatically create a pattern database from a log file containing a large number of log messages. The resulting pattern database is printed to the standard output (stdout). The pdbtool patternize command uses a data clustering technique to find similar log messages and replacing the differing parts with @ESTRING:: @ parsers. For details on pattern databases and message parsers, see the The syslog-ng OSE Administrator Guide β¨https://www.syslog-ng.com/β©. The patternize command is available only in version 3.2 and later. β¨
--debugor-dβ Enable debug/diagnostic messages onstderr.--file=<path>or-fβ The logfile containing the log messages to create patterns from. To receive the log messages from the standard input (stdin), use-.--iterate-outliersor-oβ Recursively iterate on the log lines to cover as many log messages with patterns as possible. π--named-parsersor-nβ The number of example log messages to include in the pattern database for every pattern. Default value:1--no-parseor-pβ Do not parse the input file, treat every line as the message part of a log message.--samples=<number-of-samples>β Include a generated name in the parsers, for example,.dict.string1,.dict.string2, and so on.--support=<number>or-Sβ A pattern is added to the output pattern database if at least the specified percentage of log messages from the input logfile match the pattern. For example, if the input logfile contains 1000 log messages and the--support=3.0option is used, a pattern is created only if the pattern matches at least 3 percent of the log messages (that is, 30 log messages). Ifpatternizedoes not create enough patterns, try to decrease the support value. Default value:4.0--verboseor-vβ Enable verbose messages onstderr.
πΈ EXAMPLE: PATTERINZE
pdbtool patternize --support=2.5 --file=/var/log/messages
β THE TEST COMMAND β
test [options]
Use the test command to validate a pattern database XML file. Note that you must have the xmllint application installed. The test command is available only in syslog-ng OSE version 3.2 and later. π§ͺ
--color-outor-cβ Enable coloring in terminal output. π--debugor-dβ Enable debug/diagnostic messages onstderr.--debugor-Dβ Print debugging information on non-matching patterns.--rule-idor-rβ Test only the patterndb rule (specified by its rule id) against its example.--validateβ Validate a pattern database XML file. β--verboseor-vβ Enable verbose messages onstderr.
πΈ EXAMPLE: TEST
pdbtool test --validate /home/me/mypatterndb.pdb
π FILES π
okay so here's where the files live, bestie, and yes these are the actual literal paths, no cap:
/Users/hofi/Develop/Balabit/syslog-ng/build/install//Users/hofi/Develop/Balabit/syslog-ng/build/install/etc/syslog-ng.conf
NOTE: If you experience any problems or need help with syslog-ng OSE, see the syslog-ng OSE Administration Guide<sup>[1]</sup>, or visit the syslog-ng OSE mailing list<sup>[2]</sup>. For news and notifications about syslog-ng OSE, visit the syslog-ng OSE blogs<sup>[3]</sup>.
like if something's acting up, do NOT just suffer in silence π go read the guide, hop on the mailing list, or check the blogs. the community is right there, fr fr π«Ά
βοΈ AUTHOR βοΈ
This manual page was generated from the syslog-ng OSE Administration Guide<sup>[1]</sup>, which was written by several contributors to whom we'd like to extend our sincere thanks.
shoutout to the contributors, honestly π they wrote the whole guide this page got generated from and we are so grateful. iconic behaviour, no notes π
Β©οΈ COPYRIGHT Β©οΈ
(okay so the original page has this heading and then... literally nothing under it. zero words. it's giving mysterious. so we're leaving it exactly as empty as we found it π )
π NOTES π
- syslog-ng OSE Administration Guide β¨https://syslog-ng.github.io/admin-guide/READMEβ©
- syslog-ng OSE mailing list β¨https://lists.balabit.hu/mailman/listinfo/syslog-ngβ©
- syslog-ng OSE blogs β¨https://syslog-ng.com/blog/β©
and that's the whole page, bestie!! π this one came to you from version 4.10.2, dated 18 December 2025, and it's the pdbtool(1) manual β go forth and parse those patterns like the main character you are π
β¨π¦
π¦ where this page comes from
- alpine 3.24: syslog-ng-doc 4.11.0-r0 Β· GPL-2.0-or-later
- arch rolling: syslog-ng 4.12.0-3 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: syslog-ng 4.11.0-1.fc44 Β· GPL-2.0-or-later
- fedora 44: syslog-ng 4.11.0-1.fc44 Β· GPL-2.0-or-later
- nixpkgs unstable: syslog-ng 4.12.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms