Created on 08-21-2018 07:41 AM - edited 09-16-2022 06:36 AM
I new in Apache Nifi and I'd like searh a text in the lines of a text file . The lines that match get write in the File. Is this possible with Apache nifi?
Created on 08-21-2018 11:09 AM - edited 08-17-2019 06:39 PM
You can use RouteText processor
Routes textual data based on a set of user-defined rules. Each line in an incoming FlowFile is compared against the values specified by user-defined Properties. The mechanism by which the text is compared to these user-defined properties is defined by the 'Matching Strategy'. The data is then routed according to these rules, routing each line of the text individually.
Example:
I have an input data as follows:
nifi hdf kyjkglhkghfgdsa hdp jdfdf nifi
RouteText configs:
Route text processor having alot of ways to determine Matching Strategy and i'm using contains strategy and added new dynamic property as
required
nifi
the matched relationship from RouteText processor will give
nifi hdf hdp jdfdf nifi
Only the above two lines having nifi in them so processor given results as expected.
Like this way you can choose any of Matching Strategy and add dynamic properties based on the strategies(i.e match regular expression means your dynamic property will be REGEX).
-
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
Created on 08-21-2018 11:09 AM - edited 08-17-2019 06:39 PM
You can use RouteText processor
Routes textual data based on a set of user-defined rules. Each line in an incoming FlowFile is compared against the values specified by user-defined Properties. The mechanism by which the text is compared to these user-defined properties is defined by the 'Matching Strategy'. The data is then routed according to these rules, routing each line of the text individually.
Example:
I have an input data as follows:
nifi hdf kyjkglhkghfgdsa hdp jdfdf nifi
RouteText configs:
Route text processor having alot of ways to determine Matching Strategy and i'm using contains strategy and added new dynamic property as
required
nifi
the matched relationship from RouteText processor will give
nifi hdf hdp jdfdf nifi
Only the above two lines having nifi in them so processor given results as expected.
Like this way you can choose any of Matching Strategy and add dynamic properties based on the strategies(i.e match regular expression means your dynamic property will be REGEX).
-
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
Created 08-21-2018 11:57 AM