Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 09-22-2016 05:25 PM
Hi,
I have a scenario where I want to ignore flow files if an attribute of a flowfile contains invalid value (like filename contains invalid value i.e name of a directory rather then a filename)
Is there a way to totally discard/ignore a FlowFile on the base of an attribute value?
Thanks
Obaid
Created 09-22-2016 05:29 PM
The RouteOnAttribute processor is what you're looking for, you can match on an attribute value (for example), and only route to a "matched" relationship; self-terminating the "unmatched" relationship would cause the FlowFile to be discarded/ignored. Also if you want to do any error handling you could route unmatched flow files to another processor to log or otherwise handle them.
Created 09-22-2016 05:29 PM
The RouteOnAttribute processor is what you're looking for, you can match on an attribute value (for example), and only route to a "matched" relationship; self-terminating the "unmatched" relationship would cause the FlowFile to be discarded/ignored. Also if you want to do any error handling you could route unmatched flow files to another processor to log or otherwise handle them.
Created 09-22-2016 05:32 PM
I'd add as a comment to Matt's answer that you can check the content of your attributes using the expression language [1]. It provides a lot of functions to deal with attributes and apply conditions to route your flow files if and only if they respect the conditions you want.
[1] https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html
Created 09-22-2016 05:34 PM
Thanks a lot @Matt Burgess and @Pierre Villard for a quick response,
Created 09-07-2017 01:11 PM
Hello,
Is it possible to compare the attributes of two different flowfiles and only pass one if the comparisson results matched?
Thank you,
Jon
Created 09-07-2017 07:17 PM
This should be a new question in HCC, not appended to your first question.
Created 09-08-2017 07:19 AM
Hi,
New question added here:
https://community.hortonworks.com/questions/135939/compare-attributes-of-different-flowfiles.html
Hope you can help me.
Jon