# smart host filter regex

**URL:** <https://forum.ansible.com/t/smart-host-filter-regex/27703>\
**Category:** Ansible Developer\
**Tags:** rhel\
**Created:** [June 4, 2018, 7:36pm UTC](https://forum.ansible.com/t/smart-host-filter-regex/27703 "2018-06-04T19:36:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lorenzo\_Farinas](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@Lorenzo\_Farinas](https://forum.ansible.com/u/Lorenzo_Farinas)\
**Post date:** [June 4, 2018, 7:36pm UTC](https://forum.ansible.com/t/smart-host-filter-regex/27703/1 "2018-06-04T19:36:14Z")

</div>

I’m trying to filter our Tier 1 RHEL servers on Ansible Tower smart inventory that have ip’s of 10.5.x.x, 10.50.x.x, and 10.51.x.x. Red Hat provided this syntax for smart host filter, name.regex:“^10.5[0-1].._$|^10.5.._$”, but it did not work as I’m getting 'No records matched your search’ . I found out the variable for ip’s when I looked at the Details for a host in Ansible Tower is ip, so i replaced name.regex with ip.regex:“^10.5[0-1].._$|^10.5.._$”, but I got error invalid quiery. Please advise.

---

<div class="post-metadata">

**Author:** ![maxamillion](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/maxamillion/32/98_2.png) [@maxamillion](https://forum.ansible.com/u/maxamillion)\
**Post date:** [June 19, 2018, 2:47pm UTC](https://forum.ansible.com/t/smart-host-filter-regex/27703/2 "2018-06-19T14:47:55Z")

</div>

> I'm trying to filter our Tier 1 RHEL servers on Ansible Tower smart inventory that have ip's of 10.5.x.x, 10.50.x.x, and 10.51.x.x. Red Hat provided this syntax for smart host filter, name.regex:"^10\.5[0-1]\..\*$|^10\.5\..\*$", but it did not work as I'm getting 'No records matched your search’ . I found out the variable for ip's when I looked at the Details for a host in Ansible Tower is ip, so i replaced name.regex with ip.regex:"^10\.5[0-1]\..\*$|^10\.5\..\*$", but I got error invalid quiery. Please advise.

I think this would be a better question for the Ansible Users mailing  
list as this list is meant for development related discussion.

[https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information](https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information)

-AdamM
