# Filtering with Values within Dictionary of the List (FortiOS Facts)

**URL:** <https://forum.ansible.com/t/filtering-with-values-within-dictionary-of-the-list-fortios-facts/37643>\
**Category:** Ansible Developer\
**Created:** [February 9, 2023, 7:27pm UTC](https://forum.ansible.com/t/filtering-with-values-within-dictionary-of-the-list-fortios-facts/37643 "2023-02-09T19:27:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ume90009](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ume90009/32/7189_2.png) [@ume90009](https://forum.ansible.com/u/ume90009)\
**Post date:** [February 9, 2023, 7:27pm UTC](https://forum.ansible.com/t/filtering-with-values-within-dictionary-of-the-list-fortios-facts/37643/1 "2023-02-09T19:27:08Z")

</div>

Hello All,

I am tyring to use filter with Values within Dictionary of the List (FortiOS Facts). Sample Resp onse from FortiGate (Facts)

“results”: [  
{  
“policyid”: 1,  
“q\_origin\_key”: 1,  
“status”: “enable”,  
“name”: “test-policy01”,  
“uuid”: “c4de3298-97ce-51ed-ccba-cafc556ba9e0”,  
“uuid-idx”: 14729,  
“srcintf”: [  
{  
“name”: “port2”,  
“q\_origin\_key”: “port2”  
}  
],

Ansible Filter works fine for the following code

- name: To Fetch Existing Firewall Polices Based on Selector firewall\_policy  
fortios\_configuration\_fact:  
vdom: “{{ vdom }}”  
access\_token: “{{ fortigate\_access\_token }}”  
selector: “firewall\_policy”  
filters:

- action==“accept”  
register: existing\_fw\_policy\_object  
when: existing\_fw\_name is defined

- name: Display Existing Firewall Policy  
debug:  
msg: “{{ existing\_fw\_policy\_object }}”

What is the way to filter on srcintf. Wanted to Filter Firewall Policy with port2.
