# Ansible Python API 2.0 - capture warnings

**URL:** <https://forum.ansible.com/t/ansible-python-api-2-0-capture-warnings/27239>\
**Category:** Ansible Developer\
**Created:** [April 11, 2018, 8:19am UTC](https://forum.ansible.com/t/ansible-python-api-2-0-capture-warnings/27239 "2018-04-11T08:19:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suren\_Baskaran](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@Suren\_Baskaran](https://forum.ansible.com/u/Suren_Baskaran)\
**Post date:** [April 11, 2018, 8:19am UTC](https://forum.ansible.com/t/ansible-python-api-2-0-capture-warnings/27239/1 "2018-04-11T08:19:20Z")

</div>

Hello All  
Been circling around the Callbackbase with all possible tries , but I could not find a way till now to capture these warnings from a playbook execution with the API output

[WARNING]: \* Failed to parse hosts/UAT/ dictionary, got: \<class ‘ansible.parsing.yaml.objects.AnsibleUnicode’\>

[WARNING]: \* Failed to parse /hosts/UAT/ssh\_keys/dbrun\_46186\_1\_uat with ini plugin:: Expected key=value host variable assignment, got: RSA

[WARNING]: Could not match supplied host pattern, ignoring: primary\_host

Appreciate some help - on how to capture these warning messages when we run playbooks via the API?
