Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

append an attribute to flowfile content at the end

avatar
Expert Contributor

Hi All,

 

I am using putdatabaserecord to store a value into DB.

Now i have a flow based on failure link to (this processor), that this failed record will be stored in disc for troubleshooting.

I can store the failed record in disc by using putfile processor.

Now i wanted it more informative during debugging, as the attribute "putdatabaserecord.error" contains the error reason, i want to append the flowfile content with this error reason.

 

 I tried to acheive this using below flow..

putsql/putdbrecord -> failure-> updateattribute (this is to give the flowfile a realistic name)-> attributesToJson (destination flowfileattribute/content -> putfile

SandyClouds_0-1685028702216.png

but in attributestoJson , if the destination is kept as flowfileattribute, the flowfile dont get this attribute or if it is kept as flowfile content, original flowfile content is replaced...

My requirement is to append this single attribute to the existing flowfile content.

 

Any help or suggestion is greatly appreciated.

2 ACCEPTED SOLUTIONS

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
3 REPLIES 3

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Super Mentor

@SandyClouds If you don't care about the specific formatting of the FlowFiles content, you could use the ReplaceText processor to append test to the end of the existing content.  I am assuming that you are manually investigating the failure later and will simply remove the appended putdatabaserecord.error text during the evaluation.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt



avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login