You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Mike Thomsen <mi...@gmail.com> on 2019/05/17 17:27:05 UTC

Filter flowfiles by size from RouteOnAttribute

Is there a way to get access to the flowfile size from EL? This said to use
Content-Length, but that didn't appear to work for me on 1.8.0.

https://stackoverflow.com/questions/45854584/using-flowfile-size-as-an-argument-in-routeonattribute-nifi

Thanks,

Mike

Re: Filter flowfiles by size from RouteOnAttribute

Posted by Mike Thomsen <mi...@gmail.com>.
Andy, FWIW I just edited the question to put a prominent note directing
anyone who sees it to review your answer.

On Fri, May 17, 2019 at 3:44 PM Suman B N <su...@gmail.com> wrote:

> This totally worked for me! It is used to filter out the flow files with 0
> bytes. It allows flow files with size greater than zero.
> [image: Screen Shot 2019-05-18 at 1.00.23 AM.png]
>
> On Fri, May 17, 2019 at 11:14 PM Andy LoPresto <al...@apache.org>
> wrote:
>
>> Ha, I went to see if we could add a more helpful answer there and I see
>> I’ve been there before. The question’s author selected the incorrect answer
>> as most helpful to them. Content-Length is not a core attribute and would
>> only exist in a scenario where a previous processor populated it.
>>
>> Andy LoPresto
>> alopresto@apache.org
>> *alopresto.apache@gmail.com <al...@gmail.com>*
>> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>>
>> On May 17, 2019, at 10:29 AM, Mike Thomsen <mi...@gmail.com>
>> wrote:
>>
>> Thanks, Mark
>>
>> On Fri, May 17, 2019 at 1:29 PM Mark Payne <ma...@hotmail.com> wrote:
>>
>>> Mike,
>>>
>>> You can reference ${fileSize}. This is the size of a FlowFile in bytes.
>>>
>>> Thanks
>>> -Mark
>>>
>>> On May 17, 2019, at 1:27 PM, Mike Thomsen <mi...@gmail.com>
>>> wrote:
>>>
>>> Is there a way to get access to the flowfile size from EL? This said to
>>> use Content-Length, but that didn't appear to work for me on 1.8.0.
>>>
>>>
>>> https://stackoverflow.com/questions/45854584/using-flowfile-size-as-an-argument-in-routeonattribute-nifi
>>>
>>> Thanks,
>>>
>>> Mike
>>>
>>>
>>>
>>
>
> --
> *Suman*
> *OlaCabs*
>

Re: Filter flowfiles by size from RouteOnAttribute

Posted by Suman B N <su...@gmail.com>.
This totally worked for me! It is used to filter out the flow files with 0
bytes. It allows flow files with size greater than zero.
[image: Screen Shot 2019-05-18 at 1.00.23 AM.png]

On Fri, May 17, 2019 at 11:14 PM Andy LoPresto <al...@apache.org> wrote:

> Ha, I went to see if we could add a more helpful answer there and I see
> I’ve been there before. The question’s author selected the incorrect answer
> as most helpful to them. Content-Length is not a core attribute and would
> only exist in a scenario where a previous processor populated it.
>
> Andy LoPresto
> alopresto@apache.org
> *alopresto.apache@gmail.com <al...@gmail.com>*
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>
> On May 17, 2019, at 10:29 AM, Mike Thomsen <mi...@gmail.com> wrote:
>
> Thanks, Mark
>
> On Fri, May 17, 2019 at 1:29 PM Mark Payne <ma...@hotmail.com> wrote:
>
>> Mike,
>>
>> You can reference ${fileSize}. This is the size of a FlowFile in bytes.
>>
>> Thanks
>> -Mark
>>
>> On May 17, 2019, at 1:27 PM, Mike Thomsen <mi...@gmail.com> wrote:
>>
>> Is there a way to get access to the flowfile size from EL? This said to
>> use Content-Length, but that didn't appear to work for me on 1.8.0.
>>
>>
>> https://stackoverflow.com/questions/45854584/using-flowfile-size-as-an-argument-in-routeonattribute-nifi
>>
>> Thanks,
>>
>> Mike
>>
>>
>>
>

-- 
*Suman*
*OlaCabs*

Re: Filter flowfiles by size from RouteOnAttribute

Posted by Andy LoPresto <al...@apache.org>.
Ha, I went to see if we could add a more helpful answer there and I see I’ve been there before. The question’s author selected the incorrect answer as most helpful to them. Content-Length is not a core attribute and would only exist in a scenario where a previous processor populated it. 

Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On May 17, 2019, at 10:29 AM, Mike Thomsen <mi...@gmail.com> wrote:
> 
> Thanks, Mark
> 
> On Fri, May 17, 2019 at 1:29 PM Mark Payne <markap14@hotmail.com <ma...@hotmail.com>> wrote:
> Mike,
> 
> You can reference ${fileSize}. This is the size of a FlowFile in bytes.
> 
> Thanks
> -Mark
> 
>> On May 17, 2019, at 1:27 PM, Mike Thomsen <mikerthomsen@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Is there a way to get access to the flowfile size from EL? This said to use Content-Length, but that didn't appear to work for me on 1.8.0.
>> 
>> https://stackoverflow.com/questions/45854584/using-flowfile-size-as-an-argument-in-routeonattribute-nifi <https://stackoverflow.com/questions/45854584/using-flowfile-size-as-an-argument-in-routeonattribute-nifi>
>> 
>> Thanks,
>> 
>> Mike
> 


Re: Filter flowfiles by size from RouteOnAttribute

Posted by Mike Thomsen <mi...@gmail.com>.
Thanks, Mark

On Fri, May 17, 2019 at 1:29 PM Mark Payne <ma...@hotmail.com> wrote:

> Mike,
>
> You can reference ${fileSize}. This is the size of a FlowFile in bytes.
>
> Thanks
> -Mark
>
> On May 17, 2019, at 1:27 PM, Mike Thomsen <mi...@gmail.com> wrote:
>
> Is there a way to get access to the flowfile size from EL? This said to
> use Content-Length, but that didn't appear to work for me on 1.8.0.
>
>
> https://stackoverflow.com/questions/45854584/using-flowfile-size-as-an-argument-in-routeonattribute-nifi
>
> Thanks,
>
> Mike
>
>
>

Re: Filter flowfiles by size from RouteOnAttribute

Posted by Mark Payne <ma...@hotmail.com>.
Mike,

You can reference ${fileSize}. This is the size of a FlowFile in bytes.

Thanks
-Mark

On May 17, 2019, at 1:27 PM, Mike Thomsen <mi...@gmail.com>> wrote:

Is there a way to get access to the flowfile size from EL? This said to use Content-Length, but that didn't appear to work for me on 1.8.0.

https://stackoverflow.com/questions/45854584/using-flowfile-size-as-an-argument-in-routeonattribute-nifi

Thanks,

Mike