To do the split , you need to transform the json input into a format that allows you to do so, for that you can use JoltTransformationJson with the following Jolt Specification:
[
{
"operation": "modify-overwrite-beta",
"spec": {
"ids": "=split('[,]',@(1,id))"
}
},
{
"operation": "shift",
"spec": {
"ids": {
"*": {
"@": "[&1].id",
"@(2,Qid)": "[&1].Qid"
}
}
}
}
]
The spec above will generate the following output:
[
{
"id": "652fbf430f1f3f30a3111f11",
"Qid": 123
},
{
"id": "652fbf430f1f3f30a3333f11",
"Qid": 123
}
]
Then you can use SplitJson processor where the JsonPath Expression is set to $
To get the id attribute you can use EvaluateJsonPath as follows:
The flowfile_id is dynamic property where the value is the json path to the id of the json input. Make sure to set the Destination property to "flowfile-attribute".
If that helps please accept solution.
Thanks