My json looks like the following
[
{
"100": "ONE",
"200": "TWO"
},
{
"100": "1",
"200": "2"
}
]
and I am expecting the following output
{
"1": "ONE",
"2": "TWO"
}
I found few answers here but all have static keys but in my case keys are dynamic
Another example
{
"apiVersion": "v1",
"data": {
"bac6f56f-101c-26da-edfa-c08e6622a337": "1"
},
"kind": "ConfigMap",
"metadata": {
"annotations": {
"bac6f56f-101c-26da-edfa-c08e6622a337": "restart"
},
"creationTimestamp": "2020-06-25T14:53:06Z",
"uid": "7b1dfc3a-1357-400e-b750-a1ff98a204b9"
}
}
and the expected output is
{"restart":"1"}