- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
if the flow file contains "HdF5 file is missing Merging completed" I have to route to some processor using Route Text processor and if the flow files contains only "Merging completed" I have route to some other processor....how can I configure Route Text processor so that I can achieve the same
- Labels:
-
Apache NiFi
Created ‎05-13-2021 02:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Created on ‎05-13-2021 10:36 AM - edited ‎05-13-2021 10:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@sangee
The "RouteText" [1] processor is used to route individual lines within a multi-line content FlowFile to different relationships (essentially splitting up a multi-line FlowFile). What you are trying to accomplish can however be done using the "RouteOnContent" [2] processor.
Your sample shows content with two lines and only one of those lines containing the string "Merging completed". So I assume the other FlowFIle's content will have only one line with "Merging complete"?
If so, the "RouteOnContent" can be configured as follows:
The dynamic property I added becomes a new relationship on the processor. So any FlowFile where content matches exactly "Merging complete" will be sent to this relationship while all other FlowFiles will be routed to the pre-existing "unmatched" relationship.
[1] http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache...
If you found this help with your query, please take a moment to login and click accept on this solution.
Thank you,
Matt
Created on ‎05-13-2021 10:36 AM - edited ‎05-13-2021 10:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@sangee
The "RouteText" [1] processor is used to route individual lines within a multi-line content FlowFile to different relationships (essentially splitting up a multi-line FlowFile). What you are trying to accomplish can however be done using the "RouteOnContent" [2] processor.
Your sample shows content with two lines and only one of those lines containing the string "Merging completed". So I assume the other FlowFIle's content will have only one line with "Merging complete"?
If so, the "RouteOnContent" can be configured as follows:
The dynamic property I added becomes a new relationship on the processor. So any FlowFile where content matches exactly "Merging complete" will be sent to this relationship while all other FlowFiles will be routed to the pre-existing "unmatched" relationship.
[1] http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache...
If you found this help with your query, please take a moment to login and click accept on this solution.
Thank you,
Matt
Created ‎05-13-2021 08:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
