From 852439576eac8b8ad2e5ed8033654e92b4ca89dd Mon Sep 17 00:00:00 2001 From: Adrian Chung Date: Sun, 12 May 2024 19:11:30 +0000 Subject: [PATCH] Fix conditional/code path for vendor_product_by_source parsing --- .../etc/conf.d/sources/source_syslog/plugin.jinja | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/package/etc/conf.d/sources/source_syslog/plugin.jinja b/package/etc/conf.d/sources/source_syslog/plugin.jinja index 89caf04801..8436cbf440 100644 --- a/package/etc/conf.d/sources/source_syslog/plugin.jinja +++ b/package/etc/conf.d/sources/source_syslog/plugin.jinja @@ -219,12 +219,13 @@ source s_{{ port_id }} { rewrite { set('$(lowercase "$HOST")' value(HOST)); }; - {%- if not vendor or not product %} - {%- if use_vpscache == True %} + {%- if ( (not vendor or not product) and + (use_vpscache == True) ) %} if { parser(p_vpst_cache); }; {%- endif %} + {%- if vendor and product %} if { parser(vendor_product_by_source); }; @@ -426,12 +427,13 @@ source s_{{ port_id }} { rewrite { set('$(lowercase "$HOST")' value(HOST)); }; - {%- if not vendor or not product %} - {%- if use_vpscache == True %} + {%- if ( (not vendor or not product) and + (use_vpscache == True) ) %} if { parser(p_vpst_cache); }; {%- endif %} + {%- if vendor and product %} if { parser(vendor_product_by_source); }; @@ -479,4 +481,4 @@ source s_{{ port_id }} { }; }; {%- endif %} -}; \ No newline at end of file +};