Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

it is possible calculate result on Routeoncontent processor

it is possible calculate result on Routeoncontent processor

Contributor

I mean apply Expression Language on content : now(), gt, ge

3 REPLIES 3

Re: it is possible calculate result on Routeoncontent processor

Master Guru

@Dmitro Vasilenko

-

Some more use case details might be helpful to understand what you are trying to do.

While the dynamic properties a user creates in the RouteOnContent processor do support NiFi's Expression Language, the result of that EL is expected to be a Java regular expression which is executed against the content of the FlowFile.

-

If you want to route a FlowFile using NiFi's EL, you can use the ExtractText processor to extract the relevant part(s) from the content to an FlowFile attribute(s) and then use the RouteOnAttribute processor instead.

-

Otherwise you will need to create a Java Regular expression to that will accomplish what you want without the use of NiFi's EL functions.

-

Thank you,

Matt

Re: it is possible calculate result on Routeoncontent processor

Depending on what your input looks like, you might be able to use QueryRecord as its query supports Expression Language and allows you access to individual fields in the content.

Re: it is possible calculate result on Routeoncontent processor

Contributor
 Thanks you!!!

In my case need  route “CSV” content,   example:

Id             date_col             name                

1|2018:06:2108:40:00|Ukraine
2|2018:06:2108:15:00|USA

If    date_col less then  25 minutes   of now(),   route to    rule1 
If    date_col  great  equivalent   25 minutes   of now(),  route to    rule2

now()  =    2018:06:21 08:50:00


Result
2018:06:2108:40:00   to   rule1    <<<<<<<<<

2018:06:21 08:15:00   to   rule2     <<<<<<<<<