I have the followin json and I want to load it in python without overwriting the multiple index:
{
"data": [
{
"HOSTNAME": "test",
"STATUS": "200",
"TYPE": "linux",
"CPU": {
"SRC": "src",
"LINK": "link",
"LABEL": "cpu"
},
"CPU": {
"SRC": "src",
"LINK": "link",
"LABEL": "cpu"
},
"MEMORY": {
"SRC": "src",
"LINK": "link",
"LABEL": "cpu"
}
}
]
}
I'm using:
json.loads("HERE COMES THE JSON")
The result overwrite the index, example:
{
data:
[
{
"HOSTNAME": "test",
"STATUS": "200",
"TYPE": "linux",
"CPU": {
"SRC": "src",
"LINK": "link",
"LABEL": "cpu"
},
"MEMORY": {
"SRC": "src",
"LINK": "link",
"LABEL": "cpu"
}
}
]
}
Note that is only one CPU.
Is there any way to not overwrite it?