mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-26 06:42:08 +00:00
fix(userspace/engine): store alternatives as array in -L json output
Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
This commit is contained in:
parent
017075c346
commit
9fda7dfb93
@ -483,11 +483,13 @@ void falco_engine::describe_rule(std::string *rule, bool json) const
|
||||
r["name"] = req.at(0).name;
|
||||
r["version"] = req.at(0).version;
|
||||
|
||||
Json::Value alternatives;
|
||||
Json::Value alternatives = Json::arrayValue;
|
||||
for(size_t i = 1; i < req.size(); i++)
|
||||
{
|
||||
alternatives["name"] = req[i].name;
|
||||
alternatives["version"] = req[i].version;
|
||||
Json::Value alternative;
|
||||
alternative["name"] = req[i].name;
|
||||
alternative["version"] = req[i].version;
|
||||
alternatives.append(alternative);
|
||||
}
|
||||
r["alternatives"] = alternatives;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user