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

Nifi - EvaluateJsonPath Dynamic JSON Key

Explorer

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?

1 REPLY 1

Re: Nifi - EvaluateJsonPath Dynamic JSON Key

Guru

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.

https://community.hortonworks.com/content/kbentry/48816/nifi-to-ingest-and-transform-rss-feeds-to-hd...

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