i have below json :
{
"deveui": "1000",
"vars": [
{ "name": "CfgNo",
"value":"255" },
{
"name":"Status","value":{
"lampS": "unknown(0xff)",
"lampL": "255"
}
},
{ "name" : "Volt", "value": "255" },
{
"name" : "gps", "value": {
"lat": "12.93",
"lon": "77.69"
}
},
{"name" : "status", "value":"up"},
{"name" : "last_status_change","value": 1503 }
]
}
expected output is :
{[{ "deveui": "1000",
"CfgNo": "255",
"lampS": "unknown(0xff)",
"lampL": "255",
"Volt": "255",
"lat": "12.93",
"lon": "77.69",
"status": "up",
"last_status_change": 1503
}]}
is it possible to convert into expected output format. if so please help me to design spec.
It looks like it should be simple, but Shift can't match something differently if it is a map or a scalar. In this case, "value" in your input is sometimes a scalar, and sometime a nested map.
If you know the "names" that will be multi values, then Jolt can help.
Spec