From 5829bd0f06e2941ede427432cc6d975eb7a56c6e Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Fri, 6 Dec 2024 12:59:35 +0100 Subject: [PATCH] fix(userspace/falco): use correct filtercheck_field_info. Signed-off-by: Federico Di Pierro --- .../falco/app/actions/init_falco_engine.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/userspace/falco/app/actions/init_falco_engine.cpp b/userspace/falco/app/actions/init_falco_engine.cpp index d750e82a2ec..effdc7884ff 100644 --- a/userspace/falco/app/actions/init_falco_engine.cpp +++ b/userspace/falco/app/actions/init_falco_engine.cpp @@ -23,7 +23,7 @@ limitations under the License. using namespace falco::app; using namespace falco::app::actions; -static inline std::string format_suggested_field(const filter_check_info* info) { +static inline std::string format_suggested_field(const filtercheck_field_info* info) { std::ostringstream out; // Replace "foo.bar" with "foo_bar" @@ -46,12 +46,15 @@ static void add_suggested_output(const falco::app::state& s, std::vector fields; filterchecks.get_all_fields(fields); for(const auto& fld : fields) { - if(fld->m_fields->is_format_suggested()) { - s.engine->add_extra_output_format(format_suggested_field(fld), - src, - eo.m_tags, - eo.m_rule, - false); + for(int i = 0; i < fld->m_nfields; i++) { + const auto* fldinfo = &fld->m_fields[i]; + if(fldinfo->is_format_suggested()) { + s.engine->add_extra_output_format(format_suggested_field(fldinfo), + src, + eo.m_tags, + eo.m_rule, + false); + } } } }