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

Scheidler, Balázs balazs.scheidler at balabit.com
Thu Jul 13 07:07:22 UTC 2017


You can even combine the two set statements into one.

On Jul 13, 2017 8:31 AM, "Jorge Pereira" <jpereiran at gmail.com> wrote:

> I updated the config to use the padding()
>
>     rewrite {
>         set("$(* $(/ $R_MIN 5) 5)", value("min_slice"));
>         set("$(padding ${min_slice} 2 0)", value("min5"));
>         .............
>     }
>
> Thank you!
>
> --
> Jorge Pereira
>
> On Thu, Jul 13, 2017 at 2:10 AM, Scheidler, Balázs <
> balazs.scheidler at balabit.com> wrote:
>
>> 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/a84971503a74399d
>> ffa6b7bb27809db2760526e3
>>
>> 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
>>
>>
>>
>>
>> ____________________________________________________________
>> __________________
>> 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
>>
>>
>>
>
> ____________________________________________________________
> __________________
> 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/4285b4c9/attachment-0001.html>


More information about the syslog-ng mailing list