Support Questions

Find answers, ask questions, and share your expertise

Capture de content of a file in Nifi from HDFS

avatar
New Contributor

Hi, I have a GetHDFS processor that reads a .TXT and I need to read the content and send a email combined the content with some other default text. I tried a UpdateAttribute to capture flowfile-content and then used in PutEmail sendMessage as Hi ${content} for example, but always get a empty string.

Someone can help me

1 ACCEPTED SOLUTION

avatar
Master Mentor

@cbravom 

The UpdateAttribute processor does not read the content of the FlowFile. It is used to add or modify attributes/metadata on the NiFi FlowFile.  

For extracting the content to the FlowFile, you'll want to use a processor like ExtractText.  Keep in mind that the FlowFile attributes for all active FlowFiles is held in NiFi's heap memory.  If you can avoid extracting the content to attribute(s) and still satisfy your user case, that would be much more efficient.

If you found that any provided answer helped you, please take a moment to login and click accept below those answers.

Matt

View solution in original post

3 REPLIES 3

avatar
Community Manager

@cbravom Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @MattWho @SAMSAL @joseomjr  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Master Mentor

@cbravom 

The UpdateAttribute processor does not read the content of the FlowFile. It is used to add or modify attributes/metadata on the NiFi FlowFile.  

For extracting the content to the FlowFile, you'll want to use a processor like ExtractText.  Keep in mind that the FlowFile attributes for all active FlowFiles is held in NiFi's heap memory.  If you can avoid extracting the content to attribute(s) and still satisfy your user case, that would be much more efficient.

If you found that any provided answer helped you, please take a moment to login and click accept below those answers.

Matt

avatar
Community Manager

@cbravom Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community: