How to add attributes from external JSON to a FlowFile

Need help folks.

I have two files that should be parsed together into a single flowfile:

  1. A csv file that should be the flowfile content.
  2. A JSON file that should be the flowfile attributes.

How can I do it in NiFi without resorting to a script?

Upvotes: 0

Views: 1365

Answers (1)

Up_One
Up_One

Reputation: 5271

The logic would be :

1 - GetFile (You Read the Json)

2 - Get Attributes from Json

3 - Set filename attribute to your csv file

4 - Fetch csv file (goes straight to the flow content)

Your flow should look like this : enter image description here

I have create a sample template for this use case:

http://www.aodba.com/apache-nifi-template-integrate-multiple-files-single-flow-2/

Upvotes: 3

Related Questions