From 34ad5c43fb6d5b9850447dfc3aa1e37313fef6fd Mon Sep 17 00:00:00 2001 From: Leonardo Grasso Date: Tue, 23 Aug 2022 16:46:36 +0200 Subject: [PATCH] update(userspace/engine): add support for hostname Signed-off-by: Leonardo Grasso --- userspace/engine/formats.cpp | 4 +++- userspace/engine/formats.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/userspace/engine/formats.cpp b/userspace/engine/formats.cpp index 09884bc4..117d3d9e 100644 --- a/userspace/engine/formats.cpp +++ b/userspace/engine/formats.cpp @@ -34,7 +34,8 @@ falco_formats::~falco_formats() } string falco_formats::format_event(gen_event *evt, const std::string &rule, const std::string &source, - const std::string &level, const std::string &format, std::set &tags) + const std::string &level, const std::string &format, std::set &tags, + const std::string &hostname) { string line; @@ -83,6 +84,7 @@ string falco_formats::format_event(gen_event *evt, const std::string &rule, cons event["rule"] = rule; event["priority"] = level; event["source"] = source; + event["hostname"] = hostname; if(m_json_include_output_property) { diff --git a/userspace/engine/formats.h b/userspace/engine/formats.h index 2ed73334..d1d98100 100644 --- a/userspace/engine/formats.h +++ b/userspace/engine/formats.h @@ -30,7 +30,8 @@ public: virtual ~falco_formats(); std::string format_event(gen_event *evt, const std::string &rule, const std::string &source, - const std::string &level, const std::string &format, std::set &tags); + const std::string &level, const std::string &format, std::set &tags, + const std::string &hostname); map get_field_values(gen_event *evt, const std::string &source, const std::string &format);