# What is the correct format to use filters parameter in Ansible ad-hoc mode

**URL:** <https://forum.ansible.com/t/what-is-the-correct-format-to-use-filters-parameter-in-ansible-ad-hoc-mode/21989>\
**Category:** Ansible Project\
**Created:** [July 11, 2016, 9:09pm UTC](https://forum.ansible.com/t/what-is-the-correct-format-to-use-filters-parameter-in-ansible-ad-hoc-mode/21989 "2016-07-11T21:09:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henry\_Huang](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@Henry\_Huang](https://forum.ansible.com/u/Henry_Huang)\
**Post date:** [July 11, 2016, 9:09pm UTC](https://forum.ansible.com/t/what-is-the-correct-format-to-use-filters-parameter-in-ansible-ad-hoc-mode/21989/1 "2016-07-11T21:09:19Z")

</div>

I am trying to test the filter result using the ansible command in ad-hoc mode for ec2\_vpc\_subnet\_facts module. I can’t seem to get the “filters” parameter to work in the ad-hoc mode somehow. It keeps giving me back key value error or “unable to evaluate dictionary for filters” kind of error no matter how I put those things together.

Here’s is how my command looks like:

ansible localhost -i ./local -m ec2\_vpc\_subnet\_facts -a “profile=my-profile region=us-east-1 filters=”{ ‘vpc-id’: vpc-xxxxx }" -vvvv

And here’s the error message:

localhost | FAILED \>\> {  
“failed”: true,  
“msg”: “this module requires key=value arguments ([‘filters={’, ‘vpc-id:’, ‘vpc-xxxxx’, ‘}’])”  
}

I have played with many different formatting but I just can’t get it to work.

---

<div class="post-metadata">

**Author:** ![Henry\_Huang](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@Henry\_Huang](https://forum.ansible.com/u/Henry_Huang)\
**Post date:** [July 15, 2016, 6:58pm UTC](https://forum.ansible.com/t/what-is-the-correct-format-to-use-filters-parameter-in-ansible-ad-hoc-mode/21989/2 "2016-07-15T18:58:04Z")

</div>

Does anyone know?
