Global objects (e.g., sources, destinations, log paths, or filters) are defined in the syslog-ng configuration file. Object definitions consist of the following elements:
Type of the object: One of source,
destination, log,
filter, or template.
Identifier of the object: A unique name identifying the object. When using a reserved word as an identifier, enclose the identifier in quotation marks.
![]() |
Tip |
|---|---|
Use identifiers that refer to the type of the object they identify. For
example, prefix source objects with |
Parameters: The parameters of the object, enclosed in
braces {parameters}.
Semicolon: Object definitions end with a semicolon
(;).
The syntax is summarized as follows:
type identifier { parameters };
Objects have parameters; some of them are required, others are optional. Required
parameters are positional, meaning that they must be specified in a defined order.
Optional arguments can be specified in any order using the
option(value) format. If a parameter (optional or required) is not
specified, its default value is used. The parameters and their default values are listed
in the reference section of the particular object. See Chapter 9, Reference for details.
![]() |
Example 3.1. Using required and optional parameters |
|---|---|
|
The
source s_demo_stream1 {
unix-stream("/dev/log" max-connections(10) group(log)); };
source s_demo_stream2 {
unix-stream("/dev/log" group(log) max-connections(10)); };
|
To add comments to the configuration file, start a line with #
and write your comments. These lines are ignored by syslog-ng.
# Comment: This is a stream source
source s_demo_stream {
unix-stream("/dev/log" max-connections(10) group(log)); };
© 2007 BalaBit IT Security
Please send your comments or documentation bugs to: documentation@balabit.com