# Using stdout\[0\] in below script changes the output a lot. Trying to understand why?

**URL:** <https://forum.ansible.com/t/using-stdout-0-in-below-script-changes-the-output-a-lot-trying-to-understand-why/35145>\
**Category:** Ansible Project\
**Created:** [May 10, 2021, 7:54pm UTC](https://forum.ansible.com/t/using-stdout-0-in-below-script-changes-the-output-a-lot-trying-to-understand-why/35145 "2021-05-10T19:54:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [May 10, 2021, 7:54pm UTC](https://forum.ansible.com/t/using-stdout-0-in-below-script-changes-the-output-a-lot-trying-to-understand-why/35145/1 "2021-05-10T19:54:02Z")

</div>

My question on stdout[0] is specific to below output. As i understand from ansible documentation, stdout means that it quotes the output of a variable and [0] means referencing the first char or command. I am just trying to figure out how the definition relates to what it does in below script.

The output of show flash: is stored in custom variable called show\_flash shown below. 1st script below contains .stdout[0] after name of custom variable whereas 2nd script does not. I am trying to understand how stdout[0] affects the output the way it does given it’s above meaning?

**even though below syntax may not appear in correct format, it is properly formatted when executed and i get no error, just a different kind of output**

**SCRIPT 1:**

- name: Pass text and template\_path

ansible.utils.cli\_parse:

text: “{{ show\_flash.stdout[0] }}”

parser:

name: ansible.utils.ttp

template\_path: “templates/sample2.ttp”‘’’

**OUTPUT:**

TASK [Display facts]

ok: [ROUTER] =\> {

“msg”: [

[

{

“flash:/”: {

“bytes\_free”: 22840320,

“bytes\_total”: 122185728

**script 2:**

- name: Pass text and template\_path

ansible.utils.cli\_parse:

text: “{{ show\_flash }}”

parser:

name: ansible.utils.ttp

template\_path: “templates/sample2.ttp”

**OUTPUT:**

TASK [Display facts]

ok: [ROUTER] =\> {

“msg”: [

[

{}

]

]

}

Thanks,

Vikram
