diff --git a/userspace/engine/rule_loader.h b/userspace/engine/rule_loader.h index 4a270e4932f..622066e9253 100644 --- a/userspace/engine/rule_loader.h +++ b/userspace/engine/rule_loader.h @@ -488,6 +488,7 @@ struct rule_update_info { context cond_ctx; std::string name; std::optional cond; + std::string source; std::optional output; std::optional desc; std::optional> tags; diff --git a/userspace/engine/rule_loader_reader.cpp b/userspace/engine/rule_loader_reader.cpp index 146eed35400..378ef2039a0 100644 --- a/userspace/engine/rule_loader_reader.cpp +++ b/userspace/engine/rule_loader_reader.cpp @@ -591,6 +591,9 @@ void rule_loader::reader::read_item(rule_loader::configuration& cfg, rule_loader::context ctx(item, rule_loader::context::RULE, name, parent); + std::string source = ""; + decode_optional_val(item, "source", source, ctx); + bool has_append_flag = false; decode_optional_val(item, "append", has_append_flag, ctx); if(has_append_flag) { @@ -648,6 +651,7 @@ void rule_loader::reader::read_item(rule_loader::configuration& cfg, "append", "condition", ctx)) { + v.source = source; decode_val(item, "condition", v.cond, ctx); } @@ -682,6 +686,7 @@ void rule_loader::reader::read_item(rule_loader::configuration& cfg, "replace", "condition", ctx)) { + v.source = source; decode_val(item, "condition", v.cond, ctx); } @@ -765,6 +770,7 @@ void rule_loader::reader::read_item(rule_loader::configuration& cfg, } else if(has_append_flag) { rule_loader::rule_update_info v(ctx); v.name = name; + v.source = source; if(item["condition"].IsDefined()) { v.cond_ctx = rule_loader::context(item["condition"],