Support Questions
Find answers, ask questions, and share your expertise

Nifi - EvaluateJsonPath Dynamic JSON Key


I did a httpget to get JSON data and I want to extract each value using EvaluateJsonPath. For each value, I will http post. But I will not know the JSON key beforehand. How can I use EvaluateJsonPath?


Re: Nifi - EvaluateJsonPath Dynamic JSON Key


Maybe the best way would be to use ExecuteScript that implements a groovy (or other) script to extract the values from the json structure. Not sure what your json would look like, but you should be able to extract each value from "key":"value"

The post below does something similar with xml -- it implements a groovy script to extract subsets of the xml values (go to the section called ExecuteScript). Should be similar idea for json.

If this works for your needs, let me know by accepting the answer; else, let me know if you have any additional questions.