From a742abbdb5948d4822ed749800e01de8ff231921 Mon Sep 17 00:00:00 2001 From: Vivek Dutta Date: Wed, 7 Jan 2026 18:24:06 +0530 Subject: [PATCH] logmngr: only apply lua filter to /dev/log and kmsg input (cherry picked from commit aed793ccdb9ccdfe9c41513be496a8538c40280f) Co-authored-by: Mohd Husaam Mehdi --- logmngr/files/lib/logmngr/fluent-bit.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/logmngr/files/lib/logmngr/fluent-bit.sh b/logmngr/files/lib/logmngr/fluent-bit.sh index 707f5c1d7..a991c8928 100644 --- a/logmngr/files/lib/logmngr/fluent-bit.sh +++ b/logmngr/files/lib/logmngr/fluent-bit.sh @@ -69,6 +69,17 @@ create_service_section() { append_conf "" } +create_lua_filter_for_severity_facility() { + match_regex="$1" + + append_conf "[FILTER]" + append_conf " name lua" + append_conf " match_regex ${match_regex}" + append_conf " script /etc/fluent-bit/syslog_facility.lua" + append_conf " call map_facility_severity" + append_conf "" +} + create_default_filters() { append_conf "[FILTER]" append_conf " name modify" @@ -88,12 +99,6 @@ create_default_filters() { append_conf " match *" append_conf " hostname_key hostname" append_conf "" - - append_conf "[FILTER]" - append_conf " name lua" - append_conf " match *" - append_conf " script /etc/fluent-bit/syslog_facility.lua" - append_conf " call map_facility_severity" } create_input_section() { @@ -498,6 +503,8 @@ handle_action() { # get the template expression if any is present log_template="$(get_template_expression "$template_ref")" + create_lua_filter_for_severity_facility "$tag_regex" + # handle output, each action can be associated with an out_log and out_syslog # section so figure out if any out_log or out_syslog section is associated # with this and action and setup output accordingly.