# Control Ansible Logs

**URL:** <https://forum.ansible.com/t/control-ansible-logs/25012>\
**Category:** Ansible Project\
**Created:** [July 18, 2017, 11:41am UTC](https://forum.ansible.com/t/control-ansible-logs/25012 "2017-07-18T11:41:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mona\_Gopal](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mona\_Gopal](https://forum.ansible.com/u/Mona_Gopal)\
**Post date:** [July 18, 2017, 11:41am UTC](https://forum.ansible.com/t/control-ansible-logs/25012/1 "2017-07-18T11:41:10Z")

</div>

Hello,

is there any way to suppress some part of the log which is printing on console while Ansible playbook execution.I want to fetch only the output returned from the script.

I do not prefer to see the following output on the console.

PLAY [Apply the following configuration on all hosts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [172.19.7.113]  
TASK: [Execute] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [172.19.7.113]  
TASK: [shell echo ‘“{{ansible\_default\_ipv4.address}} {{user.stdout\_lines}}”’ \>\> /home/ansi.log] \*\*\*  
changed: [172.19.7.113 → 127.0.0.1]  
TASK: [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [172.19.7.113] =\> {  
“msg”: “172.19.7.113 [‘root’]”  
}  
PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
172.19.7.113 : ok=4 changed=2 unreachable=0 failed=0

Is there any other alternative apart from setting no\_log: true for every task??

May be going ahead I would want to see the logs of the task for which the status is changed and ignore the “ok” tasks.

Thanks in advance,

Mona G

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 18, 2017, 12:07pm UTC](https://forum.ansible.com/t/control-ansible-logs/25012/2 "2017-07-18T12:07:44Z")

</div>

This is what callback plugins are for, sadly we are 'low on docs' on  
this feature:

[https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/callback](https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/callback)

old blog post (api has changed):  
[http://jpmens.net/2012/09/11/watching-ansible-at-work-callbacks/](http://jpmens.net/2012/09/11/watching-ansible-at-work-callbacks/)
