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

Eric Berggren eberggren at apple.com
Wed Dec 8 18:37:55 CET 2010


> thanks for noticing this error. I've corrected it in the source repo of the 
> adminguide, and will update the docs on the website when someone tells me if 
> using {} within blocks is permitted (but now buggy) or forbidden.

> changing the type of the block to root should workaround the problem.

I see, it's really about using { }'s within the block definition. Making it a "root" block (as a completely separately log {} stanza) is probably cleaner in this particular case, but the same restriction applies at the moment -- the example from the OSE 3.2 documentation [5.3.2]:

    block root mylogs() {
        source s_file { file("/var/log/mylogs.log" follow_freq(1)); };
        destination d_local { file("/var/log/messages"); };
        log { source(s_file); destination(d_local); };
    };

doesn't parse either  (same error on the final "};")

The documentation (html/PDF) could use some minor updates in this area for clarity:

- block definitions also require ()'s after the name (including non-parameterized); e.g.  block root foo() { ... }
- perhaps add an additional example for using parameterized blocks; e.g.
    block destination foo ( logname("some.log") ) {
        file( "/var/log/`logname`" ... );
    };
    destination bar {
        foo( logname("other.log") )
    };
    destination baz {
        foo()
    };

regards,
-eric
ps: I have yet to actually *test* any of this new functionality myself yet (later today :)



More information about the syslog-ng mailing list