Reputation: 207
I had a 3 flowfiles which are coming from the same processor.
FF1 -> {a:1,b:2,c:'name'}
FF2 -> {a:1,b:5,c:'fruit'}
FF3 -> {a:2,b:3,c:'abc'}
By using MergeContent Processor I'm able to merge all the flow files, but my requirement is to merge flow files on Key.
Expected output if I join with Key 'a':
FF1 -> [{a:1,b:2,c:'name'},{a:1,b:5,c:'fruit'}]
FF2 -> [{a:2,b:3,c:'abc'}]
Upvotes: 2
Views: 2908
Reputation: 11
One item to note for the Correlation Attribute, make sure to use the attribute name such as myAttribute1 and not ${myAttribute1}
Upvotes: 1
Reputation: 18670
MergeContent has a property called "Correlation Attribute" which is the name of a flow file attribute that will be used to group together flow files with the same value for the attribute (the key in your example).
You will need to extract the value of field "a" into a flow file attribute using something like EvaluateJsonPath, or ExtractText, or some custom scripted processor, then once you get into an attribute like "my.key" then you put "my.key" into the Correlation Attribute property.
Upvotes: 5