# Json output

**URL:** <https://forum.ansible.com/t/json-output/31049>\
**Category:** Ansible Project\
**Created:** [August 15, 2019, 3:19pm UTC](https://forum.ansible.com/t/json-output/31049 "2019-08-15T15:19:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinod93pop](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@vinod93pop](https://forum.ansible.com/u/vinod93pop)\
**Post date:** [August 15, 2019, 3:19pm UTC](https://forum.ansible.com/t/json-output/31049/1 "2019-08-15T15:19:49Z")

</div>

Hi Folks,  
I need your help here, how can i get all hostnames (marked) to print. when i try msg: “{{results.json.actions[0].system.hostname}}” and msg: “{{results.json.actions[1].system.hostname}}” it prints me the two hosts, but i need all hosts availble in single msg – tried this --msg: “{{results.json.actions[\*].system.hostname}}” not working. i am still confused in getting info from json can some one give me good link to learn about this.

I used URI module to fetch this info:

ok: [localhost] =\> {  
“msg”: {  
“cache\_control”: “no-cache”,  
“changed”: false,  
“connection”: “close”,  
“content\_length”: “2220”,  
“content\_type”: “application/json; charset=utf-8”,  
“cookies”: {  
“a5442528c5a688d4fb7fca696f6ac395”: “d19de2f36ad8eea0b2f80509777960b8”  
},  
“cookies\_string”: “a5442528c5a688d4fb7fca696f6ac395=d19de2f36ad8eea0b2f80509777960b8”,  
“date”: “Thu, 15 Aug 2019 15:12:22 GMT”,  
“etag”: “"8ac-julM1vkItyH51OY7TzLhAe1ha1o"”,  
“failed”: false,  
“json”: {  
“actions”: [  
{  
“current\_report”: {  
“details”: {},  
“id”: 1409219514  
},  
“done”: false,  
“id”: 760010,  
“maintenance\_id”: 44153,  
“rule”: {  
“ansible”: true,  
“ansible\_fix”: true,  
“ansible\_mitigation”: false,  
“category”: “Security”,  
“description”: “Kernel with loaded modules vulnerable to denial of service via Bluetooth stack (CVE-2017-1000251/Blueborne)”,  
“description\_html”: “

Kernel with loaded modules vulnerable to denial of service via Bluetooth stack (CVE-2017-1000251/Blueborne)

\n”,  
“id”: “CVE\_2017\_1000251\_kernel\_blueborne|KERNEL\_CVE\_2017\_1000251\_LOADED\_DOS”,  
“node\_id”: “3177271”,  
“reboot\_required”: true,  
“rec\_impact”: 3,  
“rec\_likelihood”: 4,  
“severity”: “ERROR”  
},  
“system”: {  
“display\_name”: null,  
“hostname”: “**",  
“isCheckingIn”: true,  
“last\_check\_in”: “2019-08-15T00:20:08.000Z”,  
“remote\_branch”: “98d1a60f-f62c-4039-a604-19bee8adc0b0”,  
“remote\_leaf”: “7636906c-a11b-4988-ade2-5f43d233bb75”,  
“system\_id”: “765884e3-381b-45f4-8780-2377c7bf1a35”,  
“system\_type\_id”: 105,  
“toString”: "**”  
}  
},  
{  
“current\_report”: {  
“details”: {},  
“id”: 1409403783  
},  
“done”: false,  
“id”: 760011,  
“maintenance\_id”: 44153,  
“rule”: {  
“ansible”: true,  
“ansible\_fix”: true,  
“ansible\_mitigation”: false,  
“category”: “Security”,  
“description”: “Kernel with loaded modules vulnerable to denial of service via Bluetooth stack (CVE-2017-1000251/Blueborne)”,  
“description\_html”: “

Kernel with loaded modules vulnerable to denial of service via Bluetooth stack (CVE-2017-1000251/Blueborne)

\n”,  
“id”: “CVE\_2017\_1000251\_kernel\_blueborne|KERNEL\_CVE\_2017\_1000251\_LOADED\_DOS”,  
“node\_id”: “3177271”,  
“reboot\_required”: true,  
“rec\_impact”: 3,  
“rec\_likelihood”: 4,  
“severity”: “ERROR”  
},  
“system”: {  
“display\_name”: null,  
“hostname”: “_**",  
“isCheckingIn”: true,  
“last\_check\_in”: “2019-08-15T03:44:41.000Z”,  
“remote\_branch”: “98d1a60f-f62c-4039-a604-19bee8adc0b0”,  
“remote\_leaf”: “97ddbbbb-9bd9-4a1a-b1a0-a92a95bd2663”,  
“system\_id”: “9b72e8d7-4b86-4cf6-9bae-688a04a5a2b3”,  
“system\_type\_id”: 105,  
“toString”: ""  
}  
}  
],  
“allow\_reboot”: true,  
“created\_by”: “cert-system-658772”,  
“description”: null,  
“end”: null,  
“hidden”: false,  
“maintenance\_id”: 44153,  
“name”: "**_\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*”,  
“overdue”: false,  
“remote\_branch”: “98d1a60f-f62c-4039-a604-19bee8adc0b0”,  
“silenced”: false,  
“start”: null,  
“suggestion”: null  
},  
“msg”: “OK (2220 bytes)”,  
“redirected”: false,  
“set\_cookie”: “a5442528c5a688d4fb7fca696f6ac395=d19de2f36ad8eea0b2f80509777960b8; path=/; HttpOnly; Secure”,  
“status”: 200,  
“url”: “[https://access.redhat.com/r/insights/v3/maintenance/44153](https://access.redhat.com/r/insights/v3/maintenance/44153)”,  
“vary”: “Accept-Encoding”,  
“x\_request\_id”: “14975d50-bf6f-11e9-9524-1d45a1f7c0df”,  
“x\_rh\_insightsapi\_host”: “insights-api-310-7dhtg”  
}  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=3 changed=0 unreachable=0 failed=0
