Support Questions

Find answers, ask questions, and share your expertise

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

avatar
Explorer

Screenshot (39).png

1 ACCEPTED SOLUTION

avatar
Master Mentor

@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:

MattWho_0-1620927036306.png

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...

[2] 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

View solution in original post

2 REPLIES 2

avatar
Master Mentor

@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:

MattWho_0-1620927036306.png

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...

[2] 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

avatar
Explorer
Thanks a lot