<div dir="ltr">I updated the config to use the padding()<div><br></div><div><div> rewrite {</div><div> set("$(* $(/ $R_MIN 5) 5)", value("min_slice"));</div><div> set("$(padding ${min_slice} 2 0)", value("min5"));</div></div><div> .............</div><div> }</div><div><br></div><div>Thank you!</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--<div>Jorge Pereira</div></div></div></div>
<br><div class="gmail_quote">On Thu, Jul 13, 2017 at 2:10 AM, Scheidler, Balázs <span dir="ltr"><<a href="mailto:balazs.scheidler@balabit.com" target="_blank">balazs.scheidler@balabit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">First of all the $(padding) template function might do exactly what you want.<div dir="auto"><br></div><div dir="auto"><a href="https://www.balabit.com/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html/reference-template-functions.html" target="_blank">https://www.balabit.com/<wbr>documents/syslog-ng-ose-<wbr>latest-guides/en/syslog-ng-<wbr>ose-guide-admin/html/<wbr>reference-template-functions.<wbr>html</a><br></div><div dir="auto"><br></div><div dir="auto">Also, in conditions you need to use $ to reference values,e.g. it should be condition($min_value ...)</div><div dir="auto"><br></div><div dir="auto"><a href="https://www.balabit.com/documents/syslog-ng-ose-latest-guides/en/syslog-ng-ose-guide-admin/html/filters-comparing.html" target="_blank">https://www.balabit.com/<wbr>documents/syslog-ng-ose-<wbr>latest-guides/en/syslog-ng-<wbr>ose-guide-admin/html/filters-<wbr>comparing.html</a><br></div><div dir="auto"><br></div><div dir="auto">And finally, there was a bug in numeric operators, which I remember to have fixed in 3.8:</div><div dir="auto"><br></div><div dir="auto"><a href="https://github.com/balabit/syslog-ng/commit/a84971503a74399dffa6b7bb27809db2760526e3" target="_blank">https://github.com/balabit/<wbr>syslog-ng/commit/<wbr>a84971503a74399dffa6b7bb27809d<wbr>b2760526e3</a><br></div><div class="gmail_extra" dir="auto"><br><div class="gmail_quote"><div><div class="h5">On Jul 13, 2017 05:27, "Jorge Pereira" <<a href="mailto:jpereiran@gmail.com" target="_blank">jpereiran@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="m_-2171043350140669521quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi List,<div><br></div><div>I am trying to use the below set() + condition()</div><div><br></div><div><div> rewrite {</div><div> set("$(* $(/ $R_MIN 5) 5)", value("min_slice"));</div><div> set("0${min_slice}", value("min5"), condition("min_slice" <= "9"));</div><div> set("${min_slice}", value("min5"), condition("min_slice" >= "10"));</div><div><br></div><div> # final macro, e.g: www.mytest.com_20170417-1001PM<wbr>-ng_lua.log.gz</div><div> set("${YEAR}${MONTH}${DAY}-${H<wbr>OUR12}${min5}${AMPM}", value("logfmt_file"));</div><div> set("${YEAR}${MONTH}${DAY}/${H<wbr>OUR12}${min5}${AMPM}", value("logfmt_dir"));</div><div> }; </div><div><br></div><div>But, does not work with R_MIN values around 1 ~ 9 then never execute the second set(... <b>condition("min_slice" <= "9")</b>) statement. Has somebody idea?</div><div><br></div><div>p.s: I am using the syslog-ng 3.7.3</div><div><br></div><div><div class="m_-2171043350140669521m_2850432791733712633gmail_signature"><div dir="ltr">--<div>Jorge Pereira</div></div></div></div>
</div></div>
<br></div></div>______________________________<wbr>______________________________<wbr>__________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/mailm<wbr>an/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/support<wbr>/documentation/?product=<wbr>syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/sy<wbr>slog-ng-faq</a><br>
<br>
<br></blockquote></div><br></div></div>
<br>______________________________<wbr>______________________________<wbr>__________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/<wbr>mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/<wbr>support/documentation/?<wbr>product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/<wbr>syslog-ng-faq</a><br>
<br>
<br></blockquote></div><br></div>