# How can i create smart inventory based on specific host variable?

**URL:** <https://forum.ansible.com/t/how-can-i-create-smart-inventory-based-on-specific-host-variable/31061>\
**Category:** AWX Project\
**Tags:** windows\
**Created:** [August 16, 2019, 1:47pm UTC](https://forum.ansible.com/t/how-can-i-create-smart-inventory-based-on-specific-host-variable/31061 "2019-08-16T13:47:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit2](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@Ankit2](https://forum.ansible.com/u/Ankit2)\
**Post date:** [August 16, 2019, 1:47pm UTC](https://forum.ansible.com/t/how-can-i-create-smart-inventory-based-on-specific-host-variable/31061/1 "2019-08-16T13:47:48Z")

</div>

I am trying to create a smart inventory based on one specific host variable called as **name**. I am trying to use the following using API but for some reason this doesn’t work:

`  
{  
“name”: “SMI\_CCA\_DIR\_WindowsServers\_10\_13”,  
“description”: “All Windows servers in dir domain with 10.13._._ series”,  
“organization”: 2,  
“kind”: “smart”,

“host\_filter”: “variables\_\_icontains="Windows" and variables\_\_name\_\_icontains="dir.svc.company.com" and variables\_\_icontains="10.13"”,

“variables”: “—\nansible\_connection: winrm\nansible\_winrm\_message\_encryption: auto\nansible\_winrm\_port: 5985\nansible\_winrm\_transport: ntlm\nno\_log: true”,  
“insights\_credential”: null  
}  
`

How can i fix the host filter to get the hosts with name variable matching value?
