- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Update JSON Element w/FlowFile Attribute - Nifi
- Labels:
-
Apache NiFi
Created ‎10-26-2016 01:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have used EvaluateJsonPath to pull a value out of a FlowFile and put it into an attribute. Then based off the value of that attribute, I have updated the attribute to a new value. Now, how do I replace the old value in the JSON with the new value that is stored as an attribute?
I'd assume I could do this with RegEx and ReplaceText but I wasn't sure if there was a more elegant way to do it?
Thanks,
Andrew
Created ‎10-26-2016 01:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AttributestoJSON as FlowFileContent
Created on ‎10-26-2016 02:19 AM - edited ‎08-18-2019 06:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But that overwrites the entire FlowFile, right? I just want to replace that one value in the JSON (while leaving the rest of the JSON AS-IS).
Created ‎08-24-2017 07:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew,
were you able to find a way to your question. I'm in a similar situation, have used EvaluateJson which creates the attribute but then i need to write this attribute to my json flowfile content.
Thanks!
Created ‎10-26-2016 02:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you looked at JoltTransformer for JSON?
Created ‎10-26-2016 06:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use UpdateAttribute processor; it has "Delete Attributes Expression" property, where you can specify the Old attribute that you want to delete; would that work ?
Created ‎01-15-2019 04:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Andrew Watson Hi Andrew did you find a way out for this issue
