# Print only output after assessmentTemplateArn

**URL:** <https://forum.ansible.com/t/print-only-output-after-assessmenttemplatearn/30005>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [March 27, 2019, 10:57pm UTC](https://forum.ansible.com/t/print-only-output-after-assessmenttemplatearn/30005 "2019-03-27T22:57:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinkuchowdary32](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tinkuchowdary32](https://forum.ansible.com/u/tinkuchowdary32)\
**Post date:** [March 27, 2019, 10:57pm UTC](https://forum.ansible.com/t/print-only-output-after-assessmenttemplatearn/30005/1 "2019-03-27T22:57:05Z")

</div>

how can i get only the arn value but not complete output saved in to variable

in the below example

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [localhost] =\> {

“template\_arn.results.0.stdout\_lines[1]”: " "assessmentTemplateArn": "arn:aws:inspector:us-west-2:024283424342:target/0-Rrtw16WK/template/0-5KIIPQREcC""

i want to print only arn:aws:inspector:us-west-2:024283424342:target/0-Rrtw16WK/template/0-5KIIPQREcC\ i dont want “”““assessmentTemplateArn””“” to be saved to my variable  
Can anyone please help

Thank you

---

<div class="post-metadata">

**Author:** ![tinkuchowdary32](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tinkuchowdary32](https://forum.ansible.com/u/tinkuchowdary32)\
**Post date:** [March 27, 2019, 10:59pm UTC](https://forum.ansible.com/t/print-only-output-after-assessmenttemplatearn/30005/2 "2019-03-27T22:59:45Z")

</div>

playbook task

- name: “create Assessment template”

command: “{{ item }}”

with\_items:

- aws inspector create-assessment-template --assessment-target-arn {{ target\_arn }} --assessment-template-name {{ assessment\_template\_name }} --duration-in-seconds {{ run\_duration }} --rules-package-arns {{ rules\_arn }}

register: template\_arn

tags: create-assessment-template

- debug:

var: template\_arn.results.0.stdout\_lines[1]

tags: create-assessment-template

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 28, 2019, 6:01am UTC](https://forum.ansible.com/t/print-only-output-after-assessmenttemplatearn/30005/3 "2019-03-28T06:01:24Z")

</div>

The output of that command is already json. Instead of fragile filtering a (hopefully) single line that contains your value and then trying to unquote that, please use the entire output in combination with the from\_json filter to access the value.

Dick

---

<div class="post-metadata">

**Author:** ![tinkuchowdary32](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tinkuchowdary32](https://forum.ansible.com/u/tinkuchowdary32)\
**Post date:** [March 29, 2019, 3:51am UTC](https://forum.ansible.com/t/print-only-output-after-assessmenttemplatearn/30005/4 "2019-03-29T03:51:16Z")

</div>

thank you for the advise but i am new to json can you please help with the commad or any reference link
