[syslog-ng] [PATCH 2/2] [dbparser] min and max message count condition in correlation actions

Gergely Nagy algernon at balabit.hu
Mon Nov 12 11:40:29 CET 2012


Balazs Scheidler <bazsi77 at gmail.com> writes:

> what about introducing a template function that expands to the number
> of elements in the context?

Mmm... that would require extending LogTemplate, and would also mean we
have to expand templates in dbparser at action calling time, which
sounds inefficient to me.

Although things like <action when="$(<= ${.context.count} 10)"> looks
cool, it would take quite a bit of work to get that done right I
believe, and its performance would, in my opinion, be rather poor.

So I'd rather have something like <action when-msg-count="<= N">,
without the template magic first.

Pros of when-msg-count:
 - Less code to implement
 - Better performance
Cons:
 - Less flexible

So.. lets have when-msg-count first, and later - if so need be - expand
it towards a generic when=, at which point when-msg-count could become a
thin, backward-compatibility wrapper around "when".

-- 
|8]



More information about the syslog-ng mailing list