This is the latest documentation.

https://docs.ansible.com/ansible/latest/collections/community/general/json_query_filter.html

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Jan 27, 2023, at 8:09 AM, 'Rowe, Walter P. (Fed)' via Ansible Project 
<[email protected]> wrote:

https://docs.ansible.com/ansible/5/collections/community/general/docsite/filter_guide_selecting_json_data.html<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.ansible.com%2Fansible%2F5%2Fcollections%2Fcommunity%2Fgeneral%2Fdocsite%2Ffilter_guide_selecting_json_data.html&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Eac4dfRebkwSR15Rn3U9av7hpTMEUqV0SGbYeT0YxPw%3D&reserved=0>


Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Jan 27, 2023, at 8:06 AM, 'Rowe, Walter P. (Fed)' via Ansible Project 
<[email protected]> wrote:

raidurl1['json'].Members should get you Members JSON list.

raidurl1 | json_query('json.Members[*][email protected]')

OR

raidurl1.json.Members | json_query('[*][email protected]')




Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Jan 27, 2023, at 2:04 AM, Linux Study <[email protected]> wrote:

Hi dick,

 Please check raidurl1 output attached. Please advice...

Regards,
Abhijit

On Thu, 26 Jan 2023, 00:16 Dick Visser, 
<[email protected]<mailto:[email protected]>> wrote:
The bracket and the u are not just some stray characters, which you seem to 
think.
Your data is structured like a nested list, and that is what is being displayed.
Adjust the json_query to remove the nested structure.

Also you didn't post your raidurl1 data so it's mostly guessing...


On Wed, 25 Jan 2023 at 17:45, Linux Study 
<[email protected]<mailto:[email protected]>> wrote:
I tried earlier but no luck... Any other suggestions?




On Wed, 25 Jan 2023, 19:22 'Rowe, Walter P. (Fed)' via Ansible Project, 
<[email protected]<mailto:[email protected]>> 
wrote:
Try piping thru "from_json | to_json" or just "to_json" filter. One of those 
worked for me. Cannot remember which one.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

On Jan 25, 2023, at 2:39 AM, Linux Study 
<[email protected]<mailto:[email protected]>> wrote:

Hello All,

I wantremove bracket and u from json data in ansible. I am trying to retrieve 
data from json.
 I executed this code in playbook

- debug:
       msg: "{{ item }}"
    loop:  "{{ raidurl1 | json_query('json.Members[*].[*]') }}"

I am getting output like

(item=[[u' /refish/v1/Systems/1']])

But i want output like
 (item= /redfish/v1/Systems/1 )


How can i remove bracket and u from item. Do i need to change anything in to 
debug loop? Please help


Thanks and regards,
Abhi

--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEcjLFwnqUC727hEDyW%2BoAiM%2B7hCOm3sNcA-oQ54JNvvHYob6A%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAEcjLFwnqUC727hEDyW%252BoAiM%252B7hCOm3sNcA-oQ54JNvvHYob6A%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Fb1mVhhMCs9AA%2FQAhnHhEzNzdEsvnVEs8oYIA0pnNuU%3D&reserved=0>.


--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/757E593A-9436-4CA5-A795-C9473E0985DA%40nist.gov<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F757E593A-9436-4CA5-A795-C9473E0985DA%2540nist.gov%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2BSD%2FeLVsVXpZyNoNviNWRXoU66TsqPMRBP3C%2FlLBbTo%3D&reserved=0>.

--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEcjLFxK7j3nXBXhEMZ5U8nbHGmowxhwQWCzOKv6K%2B91DKy3Ag%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAEcjLFxK7j3nXBXhEMZ5U8nbHGmowxhwQWCzOKv6K%252B91DKy3Ag%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1NI8PI1NgohyzxGFqf4BINYtO11S29hSytcXu98NzvE%3D&reserved=0>.
--
Sent from Gmail Mobile

--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLbUHaGnChZi6n_jC6B%2BYhwS60Ecafoc%2B%2BFRUcuDppazTQ%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAF8BbLbUHaGnChZi6n_jC6B%252BYhwS60Ecafoc%252B%252BFRUcuDppazTQ%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=cPvTmukt76v%2Fw4VcFMfzS1xTYLTplx7w8kNsKKcXPtk%3D&reserved=0>.

--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEcjLFxBXv41bfcEecWdZum5HWDpTGZUBn-EVUC5ZBP2w3iFGA%40mail.gmail.com<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAEcjLFxBXv41bfcEecWdZum5HWDpTGZUBn-EVUC5ZBP2w3iFGA%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fSm%2By%2BTagpWVB2aG4vBUOF06yGihs1cNWSIsmXHQMhA%3D&reserved=0>.
<IMG_20230127_123227.jpg>


--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0E83F61C-931B-4B93-ABD9-19555484F803%40nist.gov<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F0E83F61C-931B-4B93-ABD9-19555484F803%2540nist.gov%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=rfP3JFjV7it5Ijqt79EwSQzv3DXK2p0MhRIKzgHIWc4%3D&reserved=0>.


--
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/C5F0F952-BDF8-4FFA-A43B-D865E7DC56CB%40nist.gov<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FC5F0F952-BDF8-4FFA-A43B-D865E7DC56CB%2540nist.gov%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C503c0014528f492e708808db0067b5e9%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638104217655976385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=44NpbOo9HJVByrRmMVWvdMReKP7TElZ%2FeEJIXgmFeFc%3D&reserved=0>.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/595D73AA-AB23-4169-A58E-BBCD37A2C5B1%40nist.gov.

Reply via email to