I want to filter every keys value from below json using json_query | JMESPATH, how to achieve this?
{
"facts_hash": {
"processors::count": "96",
"processors::physicalcount": "2",
"processor0": "Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz",
"processorcount": "96",
"macaddress": "08:f1:ea:6d:04:3G",
"ipaddress": "192.168.101.135",
"manufacturer": "HPE",
"productname": "ProLiant DL360 Gen10",
"serialnumber": "SGH93GDCR",
"memorysize_mb": "773730.12",
"ipmi_ipaddress": "172.16.200.28",
},
"id": 284
}
Expected output, can be as below
[ "96",
"2",
"Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz",
"96",
"08:f1:ea:6d:03:3c",
"192.168.101.135",
"HPE",
"ProLiant DL360 Gen10",
"SGH936XG91",
"773730.12",
"172.16.100.24",
"284" ]
Here is the below query which i have tried which return the value.
"{{ facts_hash | json_query('[manufacturer, ipaddress, macaddress, productname, serialnumber, processorcount, processor0, memorysize_mb, ipmi_ipaddress]') | list }}"
few keys are in json with four :: which I am not able to filter here are those keys "processors::count" & "processors::physicalcount" along with i am not able to fetch the "id"
query return value.
ok: [localhost] => {
"ansible_facts": {
"allvalue": [
"HPE",
"192.168.101.135",
"08:f1:ea:6d:03:3c",
"ProLiant DL360 Gen10",
"SGH936XG91",
"96",
"Intel(R) Xeon(R) Gold 6252 CPU @ 2.10GHz",
"773730.12",
"172.16.100.24"
]
},
"changed": false
}
Thanks