You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by DAVID SMITH <da...@btinternet.com> on 2017/06/06 19:05:08 UTC
Help with Flowfile Content to Attribute
Hi
I have a scenario where I have a flowfile which is come in and I want to email the contents to a recipient. I am currently using the putSmtp processor which works fine except that I have to email the flowfile as an attachment, so when the recipient gets the email they have to open an attachment. It would be nice to allow them to read it as a normal email body. The putSmtp processor has a property descriptor which will allow a flowfile attribute to be used as the body of the email.
So what I would like to do is, if the flowfile is less than a certain size (for arguments sake 2.5K) then I would like to make the flowfile into an attribute to use in the property Descriptor, otherwise I am happy to send it as an attachment.
Does anyone have any ideas on how after I have routed on filesize I can make my flowfile into an attribute preferably using standard processors, I am using NiFi 0.7.1?
Many thanksDave
Re: Help with Flowfile Content to Attribute
Posted by Matt Burgess <ma...@gmail.com>.
Dave,
You should be able to use ExtractText to match the entire content and put it in an attribute.
Regards,
Matt
> On Jun 6, 2017, at 3:05 PM, DAVID SMITH <da...@btinternet.com> wrote:
>
> Hi
> I have a scenario where I have a flowfile which is come in and I want to email the contents to a recipient. I am currently using the putSmtp processor which works fine except that I have to email the flowfile as an attachment, so when the recipient gets the email they have to open an attachment. It would be nice to allow them to read it as a normal email body. The putSmtp processor has a property descriptor which will allow a flowfile attribute to be used as the body of the email.
> So what I would like to do is, if the flowfile is less than a certain size (for arguments sake 2.5K) then I would like to make the flowfile into an attribute to use in the property Descriptor, otherwise I am happy to send it as an attachment.
> Does anyone have any ideas on how after I have routed on filesize I can make my flowfile into an attribute preferably using standard processors, I am using NiFi 0.7.1?
> Many thanksDave
Re: Help with Flowfile Content to Attribute
Posted by Joe Witt <jo...@gmail.com>.
Dave,
If your attachment is simply text I think you could use 'ExtractText'
to grab the whole body of the content as an attribute.
Thanks
On Tue, Jun 6, 2017 at 3:05 PM, DAVID SMITH <da...@btinternet.com> wrote:
> Hi
> I have a scenario where I have a flowfile which is come in and I want to email the contents to a recipient. I am currently using the putSmtp processor which works fine except that I have to email the flowfile as an attachment, so when the recipient gets the email they have to open an attachment. It would be nice to allow them to read it as a normal email body. The putSmtp processor has a property descriptor which will allow a flowfile attribute to be used as the body of the email.
> So what I would like to do is, if the flowfile is less than a certain size (for arguments sake 2.5K) then I would like to make the flowfile into an attribute to use in the property Descriptor, otherwise I am happy to send it as an attachment.
> Does anyone have any ideas on how after I have routed on filesize I can make my flowfile into an attribute preferably using standard processors, I am using NiFi 0.7.1?
> Many thanksDave