You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by KhajaAsmath Mohammed <md...@gmail.com> on 2021/04/24 16:12:04 UTC

Multiple OR conditions route on attribute

Hi,

I have a use case where I need to route based on multiple or conditions.

Instead of writing multiple separate conditions in route on attribute, I want to add all those attributes with or conditions . Is this possible ?

Thanks,
Khaja

Re: Multiple OR conditions route on attribute

Posted by KhajaAsmath Mohammed <md...@gmail.com>.
Thanks Chris.

Thanks,
Khaja

> On Apr 24, 2021, at 12:47 PM, Chris Sampson <ch...@naimuri.com> wrote:
> 
> 
> Yes, you can chain together multiple Expression Language OR conditions[1] in the same processor property.
> 
> For example "${filename:toLower():equals(${filename}):or(${filename:length():equals(5)}):or(${filename:endsWith('.txt')})}"
> 
> https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#or
> 
> Cheers,
> 
> Chris Sampson
> 
>> On Sat, 24 Apr 2021, 17:12 KhajaAsmath Mohammed, <md...@gmail.com> wrote:
>> Hi,
>> 
>> I have a use case where I need to route based on multiple or conditions.
>> 
>> Instead of writing multiple separate conditions in route on attribute, I want to add all those attributes with or conditions . Is this possible ?
>> 
>> Thanks,
>> Khaja

Re: Multiple OR conditions route on attribute

Posted by Chris Sampson <ch...@naimuri.com>.
Yes, you can chain together multiple Expression Language OR conditions[1]
in the same processor property.

For example "${filename:toLower():equals(${filename}):or(
${filename:length():equals(5)}):or(${filename:endsWith('.txt')})}"

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#or

Cheers,

Chris Sampson

On Sat, 24 Apr 2021, 17:12 KhajaAsmath Mohammed, <md...@gmail.com>
wrote:

> Hi,
>
> I have a use case where I need to route based on multiple or conditions.
>
> Instead of writing multiple separate conditions in route on attribute, I
> want to add all those attributes with or conditions . Is this possible ?
>
> Thanks,
> Khaja