Below is my JSON and i need JOLT to remove if destSiteName is unknown. Need to keep the rest of the object.
{
"destSiteName": "unknown",
"customer_code": "code1"
}
You might use a shift transformation which contains two conditionals
"destSiteName"
or not ( "*"
)or
"destSiteName"
is "unknown"
or not ( "*"
)[
{
"operation": "shift",
"spec": {
"destSiteName": {
"unknown": "",
"*": { "@1": "&2" }
},
"*": "&"
}
}
]