Assistance with playbook Jinja command
Hi All,
Hope everyone had a great xmas and new year break. I'm working on playbook which reads the Threat Intelligence and formats the fields but am getting the validation of the data incorrect. Looking for some advice.
Requirement:
For the pattern field below, I'd like to check the first entry, in this case network-traffic and the type is ipv4-addr and if true, then set the variable to the predefined variable of TI_Var_Type_ipv4_addr.
The jinja used is shown below, but the result is \n\n\n\n\n\n\n\n\.
Could you help me with the correct command?
Failing Command:
{% for item in vars.input.records[0].pattern %}
{% if item['network-traffic:dst_ref']['type'] == 'ipv4-addr' %}
{{vars.TI_Var_Type_ipv4_addr}}
{% break %}
{# Exit the loop since we found the matching type #}
{% endif %}
{% endfor %}
The Pattern:
pattern | : | [network-traffic:dst_ref.type = 'ipv4-addr' AND network-traffic:dst_ref.value = '191.101.234.152' AND network-traffic:dst_port = 59623] |
