Skip to content

Commit

Permalink
Changed format of the 'output' field in the JSON payload
Browse files Browse the repository at this point in the history
Signed-off-by: h4l0gen <[email protected]>
  • Loading branch information
h4l0gen committed Jan 26, 2024
1 parent 2e19960 commit bd3c09f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion userspace/engine/formats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ std::string falco_formats::format_event(gen_event *evt, const std::string &rule,
formatter = m_falco_engine->create_formatter(source, format);

// Format the original output string, regardless of output format
formatter->tostring_withformat(evt, line, gen_event_formatter::OF_NORMAL);

if(formatter->get_output_format() == gen_event_formatter::OF_JSON)
{
Expand Down Expand Up @@ -89,6 +88,7 @@ std::string falco_formats::format_event(gen_event *evt, const std::string &rule,
if(m_json_include_output_property)
{
// This is the filled-in output line.
formatter->tostring_withformat(evt, line, gen_event_formatter::OF_JSON);
event["output"] = line;
}

Expand Down Expand Up @@ -127,6 +127,10 @@ std::string falco_formats::format_event(gen_event *evt, const std::string &rule,
full_line.append("}");
line = full_line;
}
else
{
formatter->tostring_withformat(evt, line, gen_event_formatter::OF_NORMAL);
}

return line.c_str();
}
Expand Down

0 comments on commit bd3c09f

Please sign in to comment.