Created 05-25-2023 08:36 AM
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
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.
Created 05-25-2023 01:48 PM
Hi,
What is the format of the original flowfile content after PutDatabaseRecord\PUTSQL? if its something like xml or json you can use queryrecord processor or jolt transformation to enrich the content from the attributes.
Created 05-26-2023 08:40 AM
Created 05-25-2023 01:48 PM
Hi,
What is the format of the original flowfile content after PutDatabaseRecord\PUTSQL? if its something like xml or json you can use queryrecord processor or jolt transformation to enrich the content from the attributes.
Created 05-26-2023 08:01 AM
@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
Created 05-26-2023 08:40 AM