[syslog-ng] Rewrite syslog priority

Kaleemulla Sharief (kasharie) kasharie at cisco.com
Wed Mar 7 11:48:02 UTC 2018


Hi,

Is there support to change the syslog *priority* using rewrite? While I read it was not supported earlier but was planned for syslog-ng 3.2 (apologies if this is a wrong source), can someone help me with an example if it was added in any of the releases later ? Below did not work for me with syslog-ng 3.5.6 to change debug syslog to alert.

filter f_syslogd1 { match("%OS-PCE-7-CSPF_FALLBACK") and priority(debug); };

rewrite r_rewrite_set{set("1", value("PRIORITY") condition(filter(f_syslogd1)));};   #Neither 1 without quotes

log { source(s_syslog_514); rewrite (r_rewrite_set); destination(d_syslog); };

I am able to achieve this using the template hack something like below (changing to local7.alert=185) but the problem is while I can use the template inside destination definition, rewrite can be used under log section so that I can re-use same destination with different filters with or without rewrite, below will get applied to all syslogs to destination d_syslog which is not my requirement. How can I combine filters with template on same destination if rewrite is not supported. Appreciate any suggestions.
template t_asm {
   template("<185> $DATE $HOST $MSGHDR$MSG\n");
   template_escape(no);
};

destination d_syslog
         {udp("server-001" port(514) spoof_source(yes) template(t_asm));
};

Regards
~ Kaleem

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20180307/204f551a/attachment.html>


More information about the syslog-ng mailing list