0
votes

I have got json file with nested structure. I use splitjson first and then evaluatejsonpath processor to select element I am interested in. Works fine with single element to be returned but when I add more properties and change to flow file attribute. It returns the array from splitjson processor. Any help much appreciated

1
what's the problem? provide examples in your question/ - daggett

1 Answers

2
votes

Your JSONPath in SplitJson needs to point to an array to be split. If, after that, your EvaluateJsonPath points at a field that is an array, the array will be returned. If you want a flow file for each element in that array, you'll need another SplitJson processor. If your EvaluateJsonPath is putting the result(s) in an attribute, the flow file content will remain the same (i.e. the contents of the original incoming flow file). The current version of NiFi has a jsonPath function in Expression Language (https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#jsonpath) that you can use to manipulate the JSON content in the attribute.