# unexpected output while executing lengthy commands

**URL:** <https://forum.ansible.com/t/unexpected-output-while-executing-lengthy-commands/31439>\
**Category:** Ansible Project\
**Created:** [October 9, 2019, 5:31am UTC](https://forum.ansible.com/t/unexpected-output-while-executing-lengthy-commands/31439 "2019-10-09T05:31:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Netizen\_Bhoomi](https://avatars.discourse-cdn.com/v4/letter/n/5f8ce5/32.png) [@Netizen\_Bhoomi](https://forum.ansible.com/u/Netizen_Bhoomi)\
**Post date:** [October 9, 2019, 5:31am UTC](https://forum.ansible.com/t/unexpected-output-while-executing-lengthy-commands/31439/1 "2019-10-09T05:31:50Z")

</div>

Have a playbook executes the below command looking for VPN session, and registers the output. When I execute commands which are longer ( here col len \> 52 ) , the output gets messed up , as in, it’s kind of printing the input as well (have attached the output for reference). Any pointers as in how i can address this ?

- name: Check for VPN session  
asa\_command:  
commands:

- show vpn-sessiondb svc filter name {{username}}

- show vpn-sessiondb webvpn filter name {{username}}

- show vpn-sessiondb anyconnect filter name {{username}}  
register: session\_status

Output when the executed command is long [the managed host too has a longhostname]

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [loooooonghostname] =\> {  
“msg”: [  
[  
“INFO: There are presently no active sessions of the type specified”  
],  
[  
“INFO: There are presently no active sessions of the type specified”  
],  
[  
“show vpn-sessiondb anyconnect filter name longusernct filter name longuserna eshow vpn-sessiondb anyconnect filter name longuser$”,  
“INFO: There are presently no active sessions of the type specified”  
],

]  
}

Output when the executed command is relatively short.

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [loooooonghostname] =\> {  
“msg”: [  
[  
“INFO: There are presently no active sessions of the type specified”  
],  
[  
“INFO: There are presently no active sessions of the type specified”  
],  
[  
“INFO: There are presently no active sessions of the type specified”  
]  
]  
}

Thanks,  
SR

---

<div class="post-metadata">

**Author:** ![Netizen\_Bhoomi](https://avatars.discourse-cdn.com/v4/letter/n/5f8ce5/32.png) [@Netizen\_Bhoomi](https://forum.ansible.com/u/Netizen_Bhoomi)\
**Post date:** [October 9, 2019, 8:10am UTC](https://forum.ansible.com/t/unexpected-output-while-executing-lengthy-commands/31439/2 "2019-10-09T08:10:54Z")

</div>

The ASA terminal width was set to the default value of 80. When I was executing longer commands, it was exceeding the width. I should be good once i modify that value. To be aware, is there any way this can be handled within Ansible ? as in just getting the system returned output while registering ?

Thanks,  
SR
