i want to merge two flowfile that contain JSON object by same specified attribute...
flow1:
attribute:
xuuid = 123456
content:
{
"sname":"jack",
"id":"00001",
"state":"NY"
}
flow2:
attribute:
xuuid = 123456
content:
{
"country":"US",
"date":"1983"
}
and i expect this form of data in single output flow:
desired_flow:
attribute:
xuuid = 123456
content:
{
"sname":"jack",
"id":"00001",
"state":"NY",
"country":"US",
"date":"1983"
}
how do i play with this? MergeContent processor or MergeRecord? i think mergerecord can handle it but i confusing on it.
Yes MergeContent can do this for you.
I use EvalJson --> MergeContent --> AttributesToJson
I have posted a template here you can use to play around. Apache NiFi Merge Json Template
The MergeContent must have this settings : "Keep all attributes","2 a num of entires" ,"Delimiters strategy is Text"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With