I have this JSON as input:
{
"users": {
"alpha": [
"read",
"annotate",
"write",
"delete",
"manage"
],
"beta": [
"read",
"annotate",
"write",
"delete",
"manage"
],
"gamma": [
"read",
"annotate",
"write",
"delete"
],
"delta": [
"read",
"annotate",
"write",
"delete",
"manage"
]
}
}
And I've been asked to return the lists (users
) only if they contain the element manage
. Since this has to be processed with Ansible filter json_query
, it should use only the JMESPath query language.
Expected result is something like:
["alpha", "beta", "delta"]