1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
|
'\" t
.\" Title: pdbtool
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 08/19/2016
.\" Manual: The pdbtool manual page
.\" Source: syslog-ng Open Source Edition 3.3
.\" Language: English
.\"
.TH "PDBTOOL" "1" "08/19/2016" "syslog\-ng Open Source Edition" "The pdbtool manual page"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
pdbtool \- An application to test and convert syslog\-ng pattern database rules
.SH "SYNOPSIS"
.HP \w'\fBpdbtool\fR\ 'u
\fBpdbtool\fR [command] [options]
.SH "DESCRIPTION"
.PP
This manual page is only an abstract; for the complete documentation of syslog\-ng and pdbtool, see
\m[blue]\fB\fBThe syslog\-ng Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2\&.
.PP
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\&.
.PP
The
\fBpdbtool\fR
application is a utility that can be used to:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
test message patterns;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
convert an older pattern database to the latest database format;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
merge pattern databases into a single file;
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
dump the RADIX tree built from the pattern database (or a part of it) to explore how the pattern matching works\&.
.RE
.SH "THE DUMP COMMAND"
.HP \w'\fBdump\fR\ 'u
\fBdump\fR [options]
.PP
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\&.
.PP
\fB\-\-pdb\fR or \fB\-p\fR
.RS 4
Name of the pattern database file to use\&.
.RE
.PP
\fB\-\-program\fR or \fB\-P\fR
.RS 4
Displays the RADIX tree built from the patterns belonging to the
\fI$PROGRAM\fR
application\&.
.RE
.PP
\fB\-\-program\-tree\fR or \fB\-T\fR
.RS 4
Display the
\fI$PROGRAM\fR
tree\&.
.RE
.PP
Example and sample output:
.sp
.if n \{\
.RS 4
.\}
.nf
pdbtool dump \-p patterndb\&.xml \-P \*(Aqsshd\*(Aq
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
\*(Aqp\*(Aq
\*(Aqassword for\*(Aq
@QSTRING:@
\*(Aqfrom\*(Aq
@QSTRING:@
\*(Aqport \*(Aq
@NUMBER:@ rule_id=\*(Aqfc49054e\-75fd\-11dd\-9bba\-001e6806451b\*(Aq
\*(Aq ssh\*(Aq rule_id=\*(Aqfc55cf86\-75fd\-11dd\-9bba\-001e6806451b\*(Aq
\*(Aq2\*(Aq rule_id=\*(Aqfc4b7982\-75fd\-11dd\-9bba\-001e6806451b\*(Aq
\*(Aqublickey for\*(Aq
@QSTRING:@
\*(Aqfrom\*(Aq
@QSTRING:@
\*(Aqport \*(Aq
@NUMBER:@ rule_id=\*(Aqfc4d377c\-75fd\-11dd\-9bba\-001e6806451b\*(Aq
\*(Aq ssh\*(Aq rule_id=\*(Aqfc5441ac\-75fd\-11dd\-9bba\-001e6806451b\*(Aq
\*(Aq2\*(Aq rule_id=\*(Aqfc44a9fe\-75fd\-11dd\-9bba\-001e6806451b\*(Aq
.fi
.if n \{\
.RE
.\}
.SH "THE MATCH COMMAND"
.HP \w'\fBmatch\fR\ 'u
\fBmatch\fR [options]
.PP
Use the
\fBmatch\fR
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
\fI0\fR
(success) or
\fI1\fR
(no match) return code and displays the following information:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
the class assigned to the message (that is, system, violation, and so on),
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
the ID of the rule that matched the message, and
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
the values of the parsers (if there were parsers in the matching pattern)\&.
.RE
.PP
The
\fBmatch\fR
command has the following options:
.PP
\fB\-\-color\-out \fR or \fB\-c\fR
.RS 4
Color the terminal output to highlight the part of the message that was successfully parsed\&.
.RE
.PP
\fB\-\-debug\-csv\fR or \fB\-C\fR
.RS 4
Print the debugging information returned by the
\fI\-\-debug\-pattern\fR
option as comma\-separated values\&.
.RE
.PP
\fB\-\-debug\-pattern\fR or \fB\-D\fR
.RS 4
Print debugging information about the pattern matching\&. See also the
\fI\-\-debug\-csv\fR
option\&.
.RE
.PP
\fB\-\-file=<filename\-with\-path>\fR or \fB\-f\fR
.RS 4
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 (\fI\-\fR) character instead of a filename\&.
.RE
.PP
\fB\-\-filter=<filter\-expression>\fR or \fB\-F\fR
.RS 4
Print only messages matching the specified syslog\-ng filter expression\&.
.RE
.PP
\fB\-\-message\fR or \fB\-M\fR
.RS 4
The text of the log message to match (only the
\fI$MESSAGE\fR
part without the syslog headers)\&.
.RE
.PP
\fB\-\-pdb\fR or \fB\-p\fR
.RS 4
Name of the pattern database file to use\&.
.RE
.PP
\fB\-\-program\fR or \fB\-P\fR
.RS 4
Name of the program to use, as contained in the
\fI$PROGRAM\fR
part of the syslog message\&.
.RE
.PP
\fB\-\-template=<template\-expression>\fR or \fB\-T\fR
.RS 4
A syslog\-ng template expression that is used to format the output messages\&.
.RE
.PP
Example: The following command checks if the
patterndb\&.xml
file recognizes the
\fIAccepted publickey for myuser from 127\&.0\&.0\&.1 port 59357 ssh2\fR
message:
.sp
.if n \{\
.RS 4
.\}
.nf
pdbtool match \-p patterndb\&.xml \-P sshd \-M "Accepted publickey for myuser from 127\&.0\&.0\&.1 port 59357 ssh2"
.fi
.if n \{\
.RE
.\}
.PP
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
\fIuseracct\fR
tag\&.
.sp
.if n \{\
.RS 4
.\}
.nf
pdbtool match \-p sshd\&.pdb \e
\(enfile /var/log/messages \e
\(enfilter \(oqtags(\(lqusracct\(rq);\(cq
.fi
.if n \{\
.RE
.\}
.SH "THE MERGE COMMAND"
.HP \w'\fBmerge\fR\ 'u
\fBmerge\fR [options]
.PP
Use the
\fBmerge\fR
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
\m[blue]\fB\fBThe syslog\-ng Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2
for details on the different pattern database versions\&.
.PP
\fB\-\-directory\fR or \fB\-D\fR
.RS 4
The directory that contains the pattern database XML files to be merged\&.
.RE
.PP
\fB\-\-glob\fR or \fB\-G\fR
.RS 4
Specify filenames to be merged using a glob pattern, for example, using wildcards\&. For details on glob patterns, see
\fBman glob\fR\&. This pattern is applied only to the filenames, and not on directory names\&.
.RE
.PP
\fB\-\-pdb\fR or \fB\-p\fR
.RS 4
Name of the output pattern database file\&.
.RE
.PP
\fB\-\-recursive\fR or \fB\-r\fR
.RS 4
Merge files from subdirectories as well\&.
.RE
.PP
Example:
.sp
.if n \{\
.RS 4
.\}
.nf
pdbtool merge \-\-recursive \-\-directory /home/me/mypatterns/ \-\-pdb /var/lib/syslog\-ng/patterndb\&.xml
.fi
.if n \{\
.RE
.\}
.sp
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\&.
.SH "THE PATTERNIZE COMMAND"
.HP \w'\fBpatternize\fR\ 'u
\fBpatternize\fR [options]
.PP
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
\fBpdbtool patternize\fR
command uses a data clustering technique to find similar log messages and replacing the differing parts with
\fI@ESTRING:: @\fR
parsers\&. For details on pattern databases and message parsers, see the
\m[blue]\fB\fBThe syslog\-ng Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2\&. The
\fBpatternize\fR
command is available only in syslog\-ng OSE version 3\&.2 and later\&.
.PP
\fB\-\-file=<path>\fR or \fB\-f\fR
.RS 4
The logfile containing the log messages to create patterns from\&. To receive the log messages from the standard input (stdin), use
\fI\-\fR\&.
.RE
.PP
\fB\-\-iterate\-outliers\fR or \fB\-o\fR
.RS 4
Recursively iterate on the log lines to cover as many log messages with patterns as possible\&.
.RE
.PP
\fB\-\-named\-parsers\fR or \fB\-n\fR
.RS 4
The number of example log messages to include in the pattern database for every pattern\&. Default value:
\fI1\fR
.RE
.PP
\fB\-\-samples=<number\-of\-samples>\fR
.RS 4
Include a generated name in the parsers, for example,
\fI\&.dict\&.string1\fR,
\fI\&.dict\&.string2\fR, and so on\&.
.RE
.PP
\fB\-\-support=<number>\fR or \fB\-S\fR
.RS 4
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
\fI\-\-support=3\&.0\fR
option is used, a pattern is created only if the pattern matches at least 3 percent of the log messages (that is, 30 log messages)\&. If patternize does not create enough patterns, try to decrease the support value\&.
.sp
Default value:
\fI4\&.0\fR
.RE
.PP
Example:
.sp
.if n \{\
.RS 4
.\}
.nf
pdbtool patternize \-\-support=2\&.5 \-\-file=/var/log/messages
.fi
.if n \{\
.RE
.\}
.SH "THE TEST COMMAND"
.HP \w'\fBtest\fR\ 'u
\fBtest\fR [options]
.PP
Use the
\fBtest\fR
command to validate a pattern database XML file\&. Note that you must have the
\fBxmllint\fR
application installed\&. The
\fBtest\fR
command is available only in syslog\-ng OSE version 3\&.2 and later\&.
.PP
\fB\-\-validate\fR
.RS 4
Validate a pattern database XML file\&.
.RE
.PP
Example:
.sp
.if n \{\
.RS 4
.\}
.nf
pdbtool test \-\-validate /home/me/mypatterndb\&.pdb
.fi
.if n \{\
.RE
.\}
.SH "FILES"
.PP
/usr/local/bin/pdbtool
.PP
/usr/local/etc/syslog\-ng/syslog\-ng\&.conf
.SH "SEE ALSO"
.PP
\m[blue]\fB\fBThe syslog\-ng Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2
.PP
\fBsyslog\-ng\&.conf\fR(5)
.PP
\fBsyslog\-ng\fR(8)
.PP
\m[blue]\fB\fBThe syslog\-ng OSE 3\&.3 Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2
.PP
If you experience any problems or need help with syslog\-ng, visit
\m[blue]\fBvisit the syslog\-ng wiki\fR\m[]\&\s-2\u[2]\d\s+2
or the
\m[blue]\fB\fBsyslog\-ng mailing list\fR\fR\m[]\&\s-2\u[3]\d\s+2\&.
.PP
For news and notifications about of syslog\-ng, visit the
\m[blue]\fB\fBsyslog\-ng Insider Blog\fR\fR\m[]\&\s-2\u[4]\d\s+2\&.
.SH "AUTHOR"
.PP
This manual page was written by the BalaBit Documentation Team <documentation@balabit\&.com>\&.
.SH "COPYRIGHT"
.SS ""
.PP
The authors grant permission to copy, distribute and/or modify this manual page under the terms of the GNU General Public License Version 2 or newer (GPL v2+)\&.
.SH "NOTES"
.IP " 1." 4
\fBThe syslog-ng Administrator Guide\fR
.RS 4
\%http://www.balabit.com/support/documentation/
.RE
.IP " 2." 4
visit the syslog-ng wiki
.RS 4
\%http://www.balabit.com/wiki/syslog-ng-faq
.RE
.IP " 3." 4
\fBsyslog-ng mailing list\fR
.RS 4
\%https://lists.balabit.hu/mailman/listinfo/syslog-ng
.RE
.IP " 4." 4
\fBsyslog-ng Insider Blog\fR
.RS 4
\%http://insider.blogs.balabit.com
.RE
|