[syslog-ng] Creating a "log" block (OSE 3.2.1)

Eric Berggren eberggren at apple.com
Wed Dec 8 04:20:03 CET 2010


Looking to use the new fancy "block" construct in syslog-ng 3.2.1 (OSE) -- (the example in the documentation [5.3.2] doesn't parse, but figured out needs to include ()'s as well in the block definition).

Meanwhile, trying to define a "log" block, that contains other log {} stanza's, but fails to parse:

    filter f_zort { level(err); };
    destination d_weblog_unknown { file("/tmp/foo"); };

    block log bl_weblog() {
        log { destination(d_weblog_unknown); };
    Error parsing main, syntax error, unexpected '}', expecting $end in /usr/local/etc/syslog-ng.d/10-weblog at line 7, column 1: included from /etc/syslog-ng.conf line 15, column 37

    >> }; <<

The idea being I would include this within another "log { }" stanza in the main file.

If I remove "log { destination(...); };" from the "bl_weblog()" block, it parses okay.  I have another ("destination") block within the config that also parses okay (even parameterized). Strangely, commenting out the entry with a "#" at the start of that line still results in a syntax error. The error is independent of whether bl_weblog() is even referenced anywhere.

The main config may include only 'include "10-weblog"' and nothing else to demonstrate.

Seems otherwise a valid scenario, no ?


More information about the syslog-ng mailing list