[syslog-ng] Problems with set() / condition() ?

Scheidler, Balázs balazs.scheidler at balabit.com
Thu Jul 13 05:10:39 UTC 2017


First of all the $(padding) template function might do exactly what you
want.

https://www.balabit.com/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html/reference-template-functions.html

Also, in conditions you need to use $ to reference values,e.g. it should be
condition($min_value ...)

https://www.balabit.com/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html/filters-comparing.html

And finally, there was a bug in numeric operators, which I remember to have
fixed in 3.8:

https://github.com/balabit/syslog-ng/commit/a84971503a74399dffa6b7bb27809db2760526e3

On Jul 13, 2017 05:27, "Jorge Pereira" <jpereiran at gmail.com> wrote:

Hi List,

I am trying to use the below set() + condition()

    rewrite {
        set("$(* $(/ $R_MIN 5) 5)", value("min_slice"));
        set("0${min_slice}", value("min5"), condition("min_slice" <=  "9"));
        set("${min_slice}",  value("min5"), condition("min_slice" >= "10"));

        # final macro, e.g: www.mytest.com_20170417-1001PM-ng_lua.log.gz
        set("${YEAR}${MONTH}${DAY}-${HOUR12}${min5}${AMPM}",
value("logfmt_file"));
        set("${YEAR}${MONTH}${DAY}/${HOUR12}${min5}${AMPM}",
value("logfmt_dir"));
    };

But, does not work with R_MIN values around 1 ~ 9 then never execute the
second set(... *condition("min_slice" <=  "9")*) statement. Has somebody
idea?

p.s: I am using the syslog-ng 3.7.3

--
Jorge Pereira

____________________________________________________________
__________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?
product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20170713/a0707266/attachment.html>


More information about the syslog-ng mailing list