mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-27 15:17:50 +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["name"] = req.at(0).name;
|
||||||
r["version"] = req.at(0).version;
|
r["version"] = req.at(0).version;
|
||||||
|
|
||||||
Json::Value alternatives;
|
Json::Value alternatives = Json::arrayValue;
|
||||||
for(size_t i = 1; i < req.size(); i++)
|
for(size_t i = 1; i < req.size(); i++)
|
||||||
{
|
{
|
||||||
alternatives["name"] = req[i].name;
|
Json::Value alternative;
|
||||||
alternatives["version"] = req[i].version;
|
alternative["name"] = req[i].name;
|
||||||
|
alternative["version"] = req[i].version;
|
||||||
|
alternatives.append(alternative);
|
||||||
}
|
}
|
||||||
r["alternatives"] = alternatives;
|
r["alternatives"] = alternatives;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user