- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to add a line of text to a flowfile
- Labels:
-
Apache NiFi
-
Cloudera DataFlow (CDF)
Created ‎10-29-2015 09:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to add a line of text to a flowfile? Or perhaps convert an attribute to a line in a flowfile?
Created ‎10-30-2015 12:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you're looking for is a patch that was recently merged into master:https://issues.apache.org/jira/browse/NIFI-447
It allows the ReplaceText processor to do multiple new things such as prepend or append a property (expression language supported) to either every line or the whole flowfile.
Created ‎10-29-2015 09:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First, you have to ask, what's a flowfile? It may not even be a file to add to, but just some binary chunk of data, an event, or an encrypted 100GB db dump, anything, really.
Next, where would you want to add the line to? Body/payload? Attribute? Prepend or append? Various processors will be used based on those answers. Sometimes it's easier to invoke ExecuteCommand and run your favorite linux command-line hack, too 🙂
Finally, if there's complicated logic on where and how to add the line - consider a custom processor: https://cwiki.apache.org/confluence/display/NIFI/Maven+Projects+for+Extensions
Created ‎10-30-2015 12:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you're looking for is a patch that was recently merged into master:https://issues.apache.org/jira/browse/NIFI-447
It allows the ReplaceText processor to do multiple new things such as prepend or append a property (expression language supported) to either every line or the whole flowfile.
Created ‎10-30-2015 01:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We need to make sure to get the terminology correct first. A "FlowFile" in NiFi is the combination of Metadata (A map of key/value pair attribute strings) and the associated content. Are we asking how to take an Attribute that is part of the FlowFile and add it to the content portion of a FlowFile? If so, Joe's answer above covers that.
Created ‎10-30-2015 01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry about not being clear in the description. I am trying to write a line to the payload of a Flowfile. The content is simply text that I would like to add a time stamp too. Prepend or append both work.
my work around for the moment is to start with a template file that contains place holders for the various content I would like to add. I use the get file processor to pick up the template file and use the replace text processor to replace the place holders with my data. It works 😕
