# Stdout processing

**URL:** <https://forum.ansible.com/t/stdout-processing/22040>\
**Category:** Ansible Project\
**Created:** [July 18, 2016, 12:52pm UTC](https://forum.ansible.com/t/stdout-processing/22040 "2016-07-18T12:52:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Marquez](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@Eric\_Marquez](https://forum.ansible.com/u/Eric_Marquez)\
**Post date:** [July 18, 2016, 12:52pm UTC](https://forum.ansible.com/t/stdout-processing/22040/1 "2016-07-18T12:52:03Z")

</div>

Simple question, what’s the best way to capture stdout from a task that is performed? For example I want to run a command to gather some telemetry from a switch but is using the debug the best way to get the stdout data? I feel like there is a different way to do this without using debug.

---

<div class="post-metadata">

**Author:** ![psprygada](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@psprygada](https://forum.ansible.com/u/psprygada)\
**Post date:** [July 19, 2016, 10:42am UTC](https://forum.ansible.com/t/stdout-processing/22040/2 "2016-07-19T10:42:40Z")

</div>

Use a registered variable to access the return data.

See example here: [https://gist.github.com/privateip/6d3c2eb6a7301a4d20eda17af2b19be0](https://gist.github.com/privateip/6d3c2eb6a7301a4d20eda17af2b19be0)

More about registered variables here: [http://docs.ansible.com/ansible/playbooks\_variables.html#sts=Registered](http://docs.ansible.com/ansible/playbooks_variables.html#sts=Registered) Variables%C2%B6
