Member since
06-11-2019
4
Posts
2
Kudos Received
0
Solutions
01-14-2022
02:40 PM
1 Kudo
Not sure if this issue persist. Attached is one way, using only one-phase shift operation: 1. date and env are flow file attributes which should be predefined when debugging under the JOLTTransformJSON Advanced Mode. 2. When dealing with JOLT Spec, we can predefine some constant which starts with "#" for the unexist value scope "#<constant>", in that way we can then handle the rest match-and-shift work . [ {
"operation" : "shift",
"spec" : {
"logTypeCode" : {
"FIN" : {
"#END_OF_TESTING" : {
"$":"body.&3",
"#END_OF_TESTING":"customValue.logTypeCode"
}
}
},
"*" : "body.&",
"#${date}" : "header.date",
"#${env}" : {
"$" : "customValue.ENV"
}
}
} ]
==============
OR
==============
[ {
"operation" : "shift",
"spec" : {
"logTypeCode" : {
"FIN" : {
"#END_OF_TESTING" : {
"$":"body.logTypeCode",
"#END_OF_TESTING":"customValue.logTypeCode"
}
}
},
"*" : "body.&",
"#${date}" : "header.date",
"#${env}" : {
"$" : "customValue.ENV"
}
}
} ] Hope this helps. Thanks
... View more
09-30-2020
12:47 PM
Hi @calonsca! Please have a look at this spec as well! [ { "operation": "shift", "spec": { "@": "data", "ID": "&", "#${date}": "date", "#${dataset:toLower()}": "dataset" } } ]
... View more