# Single line output in AWX

**URL:** <https://forum.ansible.com/t/single-line-output-in-awx/35697>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 1, 2021, 1:56pm UTC](https://forum.ansible.com/t/single-line-output-in-awx/35697 "2021-09-01T13:56:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GXW\_Online](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@GXW\_Online](https://forum.ansible.com/u/GXW_Online)\
**Post date:** [September 1, 2021, 1:56pm UTC](https://forum.ansible.com/t/single-line-output-in-awx/35697/1 "2021-09-01T13:56:41Z")

</div>

Hi,

I have used ansible a lot on the command line and used to do things like this:

ansible -i hosts database -m shell -a ‘mysql --version’ -o

Output will be like:

DBTEST01 | CHANGED | rc=0 | (stdout) mysql Ver 14.14 Distrib 5.7.35, for Linux (x86\_64) using EditLine wrapper  
DBTEST02 | CHANGED | rc=0 | (stdout) mysql Ver 14.14 Distrib 5.7.35, for Linux (x86\_64) using EditLine wrapper

It makes the output easily greppable or easily pasted into spreadsheets etc.

But when I try to do the same sort of thing from AWX I can’t see a way to restrict the output to one line. Is there a way?

I am clicking on Inventory → my-inventory → Groups → Database → Run Command and select shell, and type the command in to Arguments, and I have the ability to change Verbosity, Limit, and Forks, but nothing equivalent to “-o”.

AWX output is in 2-line format which makes it harder to parse:

DBTEST01 | CHANGED | rc=0 \>\>  
mysql Ver 14.14 Distrib 5.7.35, for Linux (x86\_64) using EditLine wrapper  
DBTEST02 | CHANGED | rc=0 \>\>  
mysql Ver 14.14 Distrib 5.7.35, for Linux (x86\_64) using EditLine wrapper

This is a minor detail but causes additional work that the “-o” option would negate.

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [September 2, 2021, 9:32am UTC](https://forum.ansible.com/t/single-line-output-in-awx/35697/2 "2021-09-02T09:32:15Z")

</div>

Why are you bothering to use AWX for this? It’s pointless. Write playbooks/roles which are repeatable.  
You might as well just use the command line using this approach.

---

<div class="post-metadata">

**Author:** ![GXW\_Online](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@GXW\_Online](https://forum.ansible.com/u/GXW_Online)\
**Post date:** [September 3, 2021, 9:23am UTC](https://forum.ansible.com/t/single-line-output-in-awx/35697/3 "2021-09-03T09:23:22Z")

</div>

Hi Phil.

Firstly I have no command line access to AWX. It’s a shared server with RBAC giving me access to only my inventory and my projects.

Secondly, this is ad-hoc stuff, not anything I’d want to write a playbook for - especially as I have to do that in git and sync the project etc.

This is just an example of a single command I might want to run against my inventory (e.g. for audit purposes) and the command will be different each time so the effort of writing a playbook or role for every one is a waste - and that’s where the “run command” feature of AWX is so useful - but just with this one caveat that it doesn’t have a flag forcing one-line output like the -o command line option does.

If it can’t be done, it can’t be done, I’ll just have to get better at multi-line grep.
