# Parsing output

**URL:** <https://forum.ansible.com/t/parsing-output/25333>\
**Category:** Ansible Project\
**Created:** [August 25, 2017, 3:03pm UTC](https://forum.ansible.com/t/parsing-output/25333 "2017-08-25T15:03:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [August 25, 2017, 3:03pm UTC](https://forum.ansible.com/t/parsing-output/25333/1 "2017-08-25T15:03:21Z")

</div>

I have the following output from my debug (using “find”, and the debug output for “files”)

`  
{  
“atime”: 1503588437.3974097,  
“ctime”: 1503588433.7234097,  
“dev”: 2051,  
“gid”: 0,  
“inode”: 21408,  
“isblk”: false,  
“ischr”: false,  
“isdir”: false,  
“isfifo”: false,  
“isgid”: false,  
“islnk”: false,  
“isreg”: true,  
“issock”: false,  
“isuid”: false,  
“mode”: “0644”,  
“mtime”: 1503588433.7194097,  
“nlink”: 1,  
“path”: “/etc/sysconfig/network-scripts/ifcfg-enp0s3”,  
“rgrp”: true,  
“roth”: true,  
“rusr”: true,  
“size”: 278,  
“uid”: 0,  
“wgrp”: false,  
“woth”: false,  
“wusr”: true,  
“xgrp”: false,  
“xoth”: false,  
“xusr”: false  
}

`

I need to parse out `/etc/sysconfig/network-scripts/ifcfg-enp0s3 (or maybe even just ifcfg-enp0s3) from the above output.... how would I go about doing 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 25, 2017, 3:17pm UTC](https://forum.ansible.com/t/parsing-output/25333/2 "2017-08-25T15:17:52Z")

</div>

I think you have left out something of the output since find can return more  
than one answer it always return a list.

So if you use register: result on the find you can always do this.

- debug: msg='Found file: {{ item.path }}'  
&nbsp;&nbsp;with\_items: '{{ result.files }}'

---

<div class="post-metadata">

**Author:** ![John\_Harmon](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@John\_Harmon](https://forum.ansible.com/u/John_Harmon)\
**Post date:** [August 25, 2017, 3:23pm UTC](https://forum.ansible.com/t/parsing-output/25333/3 "2017-08-25T15:23:14Z")

</div>

Perfect. Thank you.
