The syslog-ng Open Source Edition application loads every available module during startup.
To load a module that is not loaded automatically, include the following statement in the syslog-ng OSE configuration file:
Note the following points about the @module statement:
The @module statement is a top-level statement, that is, it cannot be nested into any other statement. It is usually used immediately after the @version statement.
Every @module statement loads a single module: loading multiple modules requires a separate @module statement for every module.
In the configuration file, the @module statement of a module must be earlier than the module is used.
NOTE: To disable loading every module automatically, set the autoload-compiled-modules global variable to 0 in your configuration file:
@define autoload-compiled-modules 0
Note that in this case you have to explicitly load the modules you want to use.
Use the @requires statement to ensure that the specified module is loaded
To ensure that a module is loaded, include the following statement in the syslog-ng OSE configuration file or the external files included in the configuration file:
NOTE: If you include the @requires statement in the:
- syslog-ng OSE configuration file, syslog-ng OSE attempts to load the required module. If it fails to load the module, syslog-ng OSE stops and an error message is displayed.
- external files included in the configuration file, syslog-ng OSE attempts to load the required module. If it fails to load the module, only the external file is not processed.
Note that this is not true for modules marked as mandatory. You can make a dependency module mandatory by defining an error message after the @requires <module-name> statement, for example:
@requires http "The http() driver is required for elasticsearch-http(). Install syslog-ng-mod-http to continue."
Starting with syslog-ng OSE 3.25, you can use the syslog-ng-cfg-db.py utility to list the available options of configuration objects. For example, you can list all the options that can be set in the file source, and so on.
The syslog-ng-cfg-db.py utility has the following options:
- The following command lists the contexts that the utility supports.
NOTE: Currently, sources and destinations are supported.
- The following command lists the available drivers of a context:
syslog-ng-cfg-db.py -c <source|destination>
- The following command lists the available options of a specific driver and specifies the context and the driver:
syslog-ng-cfg-db.py -c <source|destination> -d <driver>
For example, to list the options of the kafka-c() destination driver:
syslog-ng-cfg-db.py -c destination -d kafka-c
The output includes the available options of the driver in alphabetical order, and the type of the option. For example:
config/option(<string> <arrow> <string-or-number>)
NOTE: The script caches the list of the options, so if you want to rebuild the database, you have to use the -r option.
Starting with syslog-ng OSE 3.25, you can visualize the configuration of a running syslog-ng OSE instance using the syslog-ng-ctl --export-config-graph command. The command walks through the effective configuration, and exports it as a graph into a JSON structure.
The resulting JSON file can be converted into DOT file format that visualization tools (for example, Graphviz) can use. The package includes a Python script to convert the exported JSON file into DOT format: <syslog-ng-installation-directory>/contrib/scripts/config-graph-json-to-dot.py
You can convert the DOT file into PNG or PDF format using external tools.
The following sections describe some methods that can be useful to simplify the management of large-scale syslog-ng installations.