Siraj ul Haq
Siraj ul Haq

Reputation: 885

Apache NiFi: read json file in ECMAScript

I am new to NiFi. My question is how can we read json file in ECMAScript while using excute script process. I want to load json file with mapping json for schema mapping.

Upvotes: 0

Views: 3840

Answers (1)

mattyb
mattyb

Reputation: 12093

I have an post on my blog about how to read in a flow file containing JSON using ExecuteScript with ECMAScript:

http://funnifi.blogspot.com/2016/03/executescript-json-to-json-revisited.html

There is also another StackOverflow question similar to your use case of reading in a mapping file and applying it to incoming data (using Groovy):

Apache NiFi ExecuteScript: Groovy script to replace Json values via a mapping file

Not sure if this helps too but I have another post on validating JSON with ExecuteScript (but Groovy not ECMAScript) using JSONSchema: http://funnifi.blogspot.com/2016/05/validating-json-in-nifi-with.html

Upvotes: 2

Related Questions