# Filter in source inventory

**URL:** <https://forum.ansible.com/t/filter-in-source-inventory/33388>\
**Category:** AWX Project\
**Tags:** azure\
**Created:** [July 13, 2020, 2:13pm UTC](https://forum.ansible.com/t/filter-in-source-inventory/33388 "2020-07-13T14:13:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafael\_Tomelin](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rafael\_Tomelin](https://forum.ansible.com/u/Rafael_Tomelin)\
**Post date:** [July 13, 2020, 2:13pm UTC](https://forum.ansible.com/t/filter-in-source-inventory/33388/1 "2020-07-13T14:13:22Z")

</div>

Hi guys,

I have source inventory by Azure and need to create the filter with this informations:

- The VMs is running
- The OS is Linux
- The name contains lnx

I create this filter nut not working  
host\_filters: “{{ powerstate == ‘running’ }} and {{ ‘lnx’ in computer\_name }} and {{ os\_profile.system == ‘linux’ }}”

How can create the filter in source inventory?

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [July 15, 2020, 7:50am UTC](https://forum.ansible.com/t/filter-in-source-inventory/33388/2 "2020-07-15T07:50:57Z")

</div>

shouldn’t that be host\_filter NOT host\_filters?

---

<div class="post-metadata">

**Author:** ![Rafael\_Tomelin](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Rafael\_Tomelin](https://forum.ansible.com/u/Rafael_Tomelin)\
**Post date:** [July 15, 2020, 4:46pm UTC](https://forum.ansible.com/t/filter-in-source-inventory/33388/3 "2020-07-15T16:46:04Z")

</div>

Hi,

The documentation is ‘filters’  
[https://docs.ansible.com/ansible/latest/plugins/inventory/azure\_rm.html](https://docs.ansible.com/ansible/latest/plugins/inventory/azure_rm.html)

**default\_host\_filters**

**exclude\_host\_filters**

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [July 15, 2020, 6:42pm UTC](https://forum.ansible.com/t/filter-in-source-inventory/33388/4 "2020-07-15T18:42:56Z")

</div>

Ok, I was looking at smart inventory where it’s host\_filter → [https://docs.ansible.com/ansible-tower/latest/html/userguide/inventories.html#smart-host-filter](https://docs.ansible.com/ansible-tower/latest/html/userguide/inventories.html#smart-host-filter)
