Variable inside json_query
Hello!
I've been having issues trying to make the json_query function to be able to parse a variable within its query. Wondering if that's actually possible. I've tried multiple solutions given in the web for the ansible "json_query", but none have worked so far.
In my script, the unique_policy_id has a list of id's - ["123", "453", "234"]. What I am trying to do is to pull FAZ logs (contained in policy_violation_logs) that match with the given policyid in each iteration, using the variable "id" within json_query.
{% for id in unique_policy_id -%}
{% set log = policy_violation_logs | json_query("[?policyid==`" ~ id ~ "`]") -%}
{{ log }}
{% endfor -%}
I would appreciate your help on this.
Thanks!
FortiSOAR
