diff --git a/package/etc/conf.d/log_paths/p_rfc3164-juniper_netscreen.conf.tmpl b/package/etc/conf.d/log_paths/p_rfc3164-juniper_netscreen.conf.tmpl index 6fca3d1..153519c 100644 --- a/package/etc/conf.d/log_paths/p_rfc3164-juniper_netscreen.conf.tmpl +++ b/package/etc/conf.d/log_paths/p_rfc3164-juniper_netscreen.conf.tmpl @@ -3,16 +3,20 @@ {{- $context := dict "port_id" "JUNIPER_NETSCREEN" "parser" "common" }} {{- tmpl.Exec "t/source_network.t" $context }} -{{- /* The following is an inline template to generate the actual log path */}} -{{- define "log_path"}} log { -{{- if eq (.) "yes"}} - source(s_DEFAULT); - filter(f_juniper_netscreen); -{{- end}} -{{- if eq (.) "no"}} - source (s_JUNIPER_NETSCREEN); + junction { + channel { + source (s_DEFAULT); + filter(f_juniper_netscreen); + flags(final); + }; +{{- if or (or (getenv (print "SC4S_LISTEN_JUNIPER_NETSCREEN_TCP_PORT")) (getenv (print "SC4S_LISTEN_JUNIPER_NETSCREEN_UDP_PORT"))) (getenv (print "SC4S_LISTEN_JUNIPER_NETSCREEN_TLS_PORT")) }} + channel { + source (s_JUNIPER_NETSCREEN); + flags (final); + }; {{- end}} + }; rewrite { set("juniper_netscreen", value("fields.sc4s_vendor_product")); @@ -31,13 +35,4 @@ log { {{- end}} flags(flow-control,final); -}; -{{- end}} - -{{- if or (or (getenv (print "SC4S_LISTEN_JUNIPER_NETSCREEN_TCP_PORT")) (getenv (print "SC4S_LISTEN_JUNIPER_NETSCREEN_UDP_PORT"))) (getenv (print "SC4S_LISTEN_JUNIPER_NETSCREEN_TLS_PORT")) }} -# Listen on the specified dedicated port(s) for JUNIPER_NETSCREEN traffic -{{ tmpl.Exec "log_path" "no" }} -{{- end }} - -# Listen on the default port (typically 514) for JUNIPER_NETSCREEN traffic -{{ tmpl.Exec "log_path" "yes" }} \ No newline at end of file +}; \ No newline at end of file