From a7e04fe6e693affc5b0724dede74a3b47ad0b817 Mon Sep 17 00:00:00 2001 From: Mark Stemm Date: Tue, 16 Mar 2021 18:28:48 -0700 Subject: [PATCH] Add falco engine info to --support output In some cases, it might be useful to know what falco engine version a given falco binary supports. We already have a --support option that prints info about the system, config, rules files, etc. Add a engine_info object, with an engine_version property containing the falco engine version in falco_engine_version.h. In the output, it looks like this: ... "engine_info": { "engine_version": 8 }, ... Signed-off-by: Mark Stemm --- userspace/falco/falco.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/userspace/falco/falco.cpp b/userspace/falco/falco.cpp index 5c0609c4..929114b7 100644 --- a/userspace/falco/falco.cpp +++ b/userspace/falco/falco.cpp @@ -41,6 +41,7 @@ limitations under the License. #include "event_drops.h" #include "configuration.h" #include "falco_engine.h" +#include "falco_engine_version.h" #include "config_falco.h" #include "statsfilewriter.h" #ifndef MINIMAL_BUILD @@ -939,6 +940,7 @@ int falco_init(int argc, char **argv) support["system_info"]["version"] = sysinfo.version; support["system_info"]["machine"] = sysinfo.machine; support["cmdline"] = cmdline; + support["engine_info"]["engine_version"] = FALCO_ENGINE_VERSION; support["config"] = read_file(conf_filename); support["rules_files"] = nlohmann::json::array(); for(auto filename : config.m_rules_filenames)