[syslog-ng]Message retension period

Balazs Scheidler syslog-ng@lists.balabit.hu
Fri, 17 Sep 2004 11:20:47 +0200


On Fri, 2004-09-17 at 10:31, Jim Mozley wrote:
> Balazs Scheidler wrote:
> > On Thu, 2004-09-16 at 18:00, Jim Mozley wrote:
> > 
> >>Balazs Scheidler wrote:
> >>
> >>
> >>
> >>>syslog-ng keeps those messages in a memory buffer, whose size is
> >>>controlled using the log_fifo_size() global/per-destination parameter.
> >>
> >>
> >>I can do this on a global level but if I try:
> >>
> >>destination loghost { tcp("loghost" port(5140)); log_fifo_size(1000); };
> >>
> >>The documentation showed log_fifo_size applicable to a file destination 
> >>but does not list it under udp and tcp destinations.
> > 
> > 
> > Hmm I can't remember whether it is applicable to tcp destinations but
> > the syntax you used above is not correct. it should be:
> > 
> > destination loghost { tcp("loghost" port(5140) log_fifo_size(1000)); };
> > 
> 
> Just tried:
> 
> destination loghost { tcp("loghost" port(5140) log_fifo_size(1000)); };
> 
> Syslog-ng reports a parse error reading the configuration file, so I'm 
> assuming this option is not supported for a tcp destination (or if it is 
> it's taken from the global option).

Checked the source, it is taken from the global option, and this patch
allows it to set it for TCP/UDP targets (though the latter will never
drop messages):

Index: cfg-grammar.y
===================================================================
RCS file: /var/cvs/syslog-ng/syslog-ng/src/cfg-grammar.y,v
retrieving revision 1.58.4.4
diff -u -r1.58.4.4 cfg-grammar.y
--- cfg-grammar.y       6 May 2004 08:57:52 -0000       1.58.4.4
+++ cfg-grammar.y       17 Sep 2004 09:18:38 -0000
@@ -497,7 +497,8 @@
        ;

 dest_afinet_option
-       : KW_LOCALIP '(' string ')'             { afinet_dest_set_localip(last_dest_driver, $3); free($3); }
+       : dest_item_option
+       | KW_LOCALIP '(' string ')'             { afinet_dest_set_localip(last_dest_driver, $3); free($3); }
        | KW_LOCALPORT '(' NUMBER ')'           { afinet_dest_set_localport(last_dest_driver, $3, NULL, NULL); }
        | KW_PORT '(' NUMBER ')'                { afinet_dest_set_destport(last_dest_driver, $3, NULL, NULL); }
        | KW_DESTPORT '(' NUMBER ')'            { afinet_dest_set_destport(last_dest_driver, $3, NULL, NULL); }


After applying the patch, rerun make (you fill need bison installed to
rebuild)


> As I understand it so far messages are kept indefinately in the buffer 
> until its full, at which point incoming messages are dropped. So if 
> log_fifo_size is only applicable to file destinations, then I would like 
> to find out how to control the buffer size for tcp destinations (or at 
> least be aware of its limitations).

log_fifo_size is applicable to TCP as well, but the parser did not allow
it setting on a per-destionation basis. With the patch above, it becomes
possible.

-- 
Bazsi