I have a use case where I have couple of key values and perform if-else operation on it. If condition is not matched then whole content will drop, else pass the content as a result.
Input json:
{
"id": 30006,
"SourceName": "network",
"Number": 1,
"SourceNameCopy": "network",
"currenttime": "Thu Aug 30 21:19:27 IST 2022"
}
My Jolt Spec:
[
{
"operation": "shift",
"spec": {
"SourceNameCopy": {
"network": {
"@1": "&2",
"#id": "id",
"#SourceName": "SourceName",
"#Number": "Number",
"#currenttime": "currenttime"
},
"hardware": {
"@1": "&2",
"#id": "id",
"#SourceName": "SourceName",
"#Number": "Number",
"#currenttime": "currenttime"
}
}
}
}
]
Expected output
if condition matched :
{
"id": 30006,
"SourceName": "network",
"Number": 1,
"SourceNameCopy": "network",
"currenttime": "Thu Aug 30 21:19:27 IST 2022"
}
Else (condition not matched) Drop the whole event as null.
Problem Statement : The Key values is getting as a string, it should contain actual value in output as a result.