Created 07-06-2018 11:42 AM
I have two flow file:
1) $.category = sport
2) $.temp_array = "music" , "sport" , "traveling"
I just want to check $.category is exist in $.temp_array or not using in expression language.
Ex.
${category:in(${temp_array})}
But it doesn't work with array or (variable). I have used this login on RouteOnAttribute processor. Instead of above example if i write like this:
${category:in("music","sport","traveling")}
then ii will give you perfect output But this is static data. Instead of this i want to use dynamic.
Please help.
Created 07-06-2018 12:20 PM
The following NiFi Expression Language statement will return "true" if a match is found:
${anyDelineatedValue("${temp_array}", ","):contains("${category}")}
-
Thanks,
Matt
-
If you found this Answer addressed your original question, please take a moment to login and click "Accept" below the answer.
Created 07-06-2018 12:20 PM
The following NiFi Expression Language statement will return "true" if a match is found:
${anyDelineatedValue("${temp_array}", ","):contains("${category}")}
-
Thanks,
Matt
-
If you found this Answer addressed your original question, please take a moment to login and click "Accept" below the answer.
Created on 07-07-2018 06:35 AM - edited 08-18-2019 02:18 AM
it doesn't work.
It directly goes to unmatched. Means condition is not worked.
I have attached
flow and configuration of RouteOnAttribute processor
Configuration of RouteOnAttribute Processor
Created 07-10-2018 01:18 PM
Based on your flow design above, it looks like you are trying to route FlowFiles by comparing attribute between two different FlowFiles? That will not work. NiFi is looking for both ${temp_array} and ${category} to exist on same flowfile being evaluated by the RouteOnAttribute processor.