[syslog-ng] [PATCH]: support setting a default suppress() globally

Gergely Nagy algernon at balabit.hu
Fri Feb 11 20:51:31 CET 2011


Hi!

Attached is a patch that makes it possible to set a default value for
suppress() in the global options block, which will then be inherited by
all drivers that support this option. Of course, it can still be
overridden on a per-destination basis.

What this means is, that if one has a larger number of destinations that
all need the same suppress settings, we'd write that like this before
this patch:

        destination d_1 {
          file("/var/log/messages-1" suppress(10));
        };
        
        destination d_2 {
          file("/var/log/messages-2" suppress(10));
        };
        
        ...
        
        destination d_N {
          file("/var/log/messages-N" suppress(10));
        };
        
        destination d_XX {
          file("/var/log/messages-XX" suppress(5));
        };
        
After the patch, this can be shortened to:

        options {
          suppress(10);
        };
        
        destination d_1 {
          file("/var/log/messages-1");
        };
        ...
        destination d_N {
          file("/var/log/messages-N");
        };
        destination d_XX {
          file("/var/log/messages-XX" suppress(5));
        };

Both result in exactly the same behaviour, but the second is a lot
shorter, and easier to maintain, as long as the majority of destinations
need the same suppress() setting.

Hopefully people will find this useful.

The patch is also available from the work/global-suppress branch of my
tree at git://git.balabit.hu/algernon/syslog-ng-3.3.git

-- 
|8]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-config-Support-setting-a-default-suppress-globally.patch
Type: text/x-patch
Size: 0 bytes
Desc: not available
Url : http://lists.balabit.hu/pipermail/syslog-ng/attachments/20110211/c4b13e06/attachment-0001.bin 


More information about the syslog-ng mailing list