# Ansible filter & search facts

**URL:** <https://forum.ansible.com/t/ansible-filter-search-facts/19440>\
**Category:** Ansible Project\
**Created:** [October 5, 2015, 3:03pm UTC](https://forum.ansible.com/t/ansible-filter-search-facts/19440 "2015-10-05T15:03:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lemming1988](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@Lemming1988](https://forum.ansible.com/u/Lemming1988)\
**Post date:** [October 5, 2015, 3:03pm UTC](https://forum.ansible.com/t/ansible-filter-search-facts/19440/1 "2015-10-05T15:03:15Z")

</div>

Hi guys,

i have a RHEL7 vm with this facts that show the network configi:

_[root@\*\*\*\*\*\* /etc/ansible]# ansible testserver -m setup -a ‘filter=ansible\_eno16777728’_  
_\*\*\*\*\*\*\*\*\*\* | success \>\> {_  
_“ansible\_facts”: {_  
_“ansible\_eno16777728”: {_  
_“active”: true,_  
_“device”: “eno16777728”,_  
_“macaddress”: “00:50:56:9d:3e:fe”,_  
_“module”: “e1000”,_  
_“mtu”: 1500,_  
_“promisc”: false,_  
_“type”: “ether”_  
_}_  
_},_  
_“changed”: false_  
_}_

Is there a way to obtain the fact “device” that display the network device name from the macaddress?

Somethig like this:

- name: Print device name know the macaddress  
debug: msg=“UUDI={{ ansible\_eno\*.device }}”  
when ansible\_eno\*.macaddress == ‘00:50:56:9d:3e:fe’

Any idea?

Thanks in advance!
