The syslog-ng application can separate parts of log messages (i.e., the contents of the $MSG macro) to named fields (columns). These fields act as user-defined macros that can be referenced in message templates, file- and tablenames, etc.
Parsers are similar to filters: they must be defined in the syslog-ng configuration file and used in the log statement.
![]() |
Note |
|---|---|
The order of filters, rewriting rules, and parsers in the log statement is important, as they are processed sequentially. |
To create a parser, define the columns of the message, the delimiter or separator characters, and optionally the characters that are used to escape the delimiter characters (quote-pairs). For the list of parser parameters, see Section 8.6, “Message parsers”.
Declaration:
parser parser_name {
csv-parser(column1, column2, ...)
delimiters()
quote-pairs()
};
Column names work like macros. Always use a prefix to identify the columns of the
parsers, e.g., MYPARSER1.COLUMN1, MYPARSER2.COLUMN2, etc. Column
names starting with a dot (e.g., .HOST) are reserved for use by
syslog-ng.
Multiple parsers can be used to split a part of an already parsed message into further segments.
© 2007-2010 BalaBit IT Security
Please send your comments or documentation bugs to: documentation@balabit.com