3.2. Defining global objects

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:

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] Example 3.1. Using required and optional parameters

The unix-stream() source driver has a single required argument: the name of the socket to listen on. Optional parameters follow the socket name in any order, so the following source definitions have the same effect:

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