# Easy way to parse out.stdout\_lines to get the value?

**URL:** <https://forum.ansible.com/t/easy-way-to-parse-out-stdout-lines-to-get-the-value/22326>\
**Category:** Ansible Project\
**Created:** [August 19, 2016, 11:06am UTC](https://forum.ansible.com/t/easy-way-to-parse-out-stdout-lines-to-get-the-value/22326 "2016-08-19T11:06:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_Ortiz](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@Ruben\_Ortiz](https://forum.ansible.com/u/Ruben_Ortiz)\
**Post date:** [August 19, 2016, 11:06am UTC](https://forum.ansible.com/t/easy-way-to-parse-out-stdout-lines-to-get-the-value/22326/1 "2016-08-19T11:06:10Z")

</div>

> up vote0down vote[favorite](http://stackoverflow.com/questions/39037046/parsing-ansible-output-with-linux-tools/39037249#)  
>   
>   
> |   
>   
>   
> I have a silly playbook which just runs a command to get the list of vhost in every host on webserver group. As all vhost are located in /var/www is easy to get the list of webs.  
>   
>   
>   
> The problem is the way of Ansible returns the info. For example:  
>   
>   
>   
> `<br>ok: [host1] => {<br> "var": {<br> "out.stdout_lines": [<br> "",<br> "host1.com"<br>]<br> }<br>}<br>ok: [host2] => {<br> "var": {<br> "out.stdout_lines": [<br> "",<br> "host2.com"<br>]<br> }<br>}<br><br>`  
>   
>   
>   
> Do you know an easy way to just get the name of the vhosts? Using grep awk or something like that?  
>   
>   
> |

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 19, 2016, 12:44pm UTC](https://forum.ansible.com/t/easy-way-to-parse-out-stdout-lines-to-get-the-value/22326/2 "2016-08-19T12:44:16Z")

</div>

Maybe Ansible ad-hoc is something too use  
ansible webservers -a "ls /var/www" | egrep -v "\>\>|^$"
