Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

apache Nifi getsftp regex filter??

apache Nifi getsftp regex filter??

New Contributor

Hi, I am using Apache Nifi to create a flow to using GetSFTP processor. I need to select the correct file for each flow separately in a single path . Can somebody help me with the correct regex expression for the below given file names: [EUtranCellRelation]_[LD10970]_[A20190131.0445] and [EUtranCellFDD]_[LD10970]_[A20190131.0445] Both the files are in the same path but I need to select each file for separate flow using the correct filter regex expression.

3 REPLIES 3

Re: apache Nifi getsftp regex filter??

New Contributor

[EUtranCellRelation] *.csv or [EUtranCellFDD] *.csv logix should be somewhat like this? the rest of the values are dynamically generated

Re: apache Nifi getsftp regex filter??

Super Guru

@Rohit Bhattacharya

Try with \[EUtranCellRelation\].*\.csv ,\[EUtranCellFDD\] *\.csv in GetSFTP processors.

(or)

Use RouteOnAttribute processor and filter out the files by matching filenames.

Flow:

1.GetSFTP processor
2.RouteOnAttribute //keep matching nifi expression to match files

Use NiFi expression language add two properties in RouteOnAttribute processor

${filename:startsWith('\[EUtranCellRelation\]')}

(or)

${filename:contains('\[EUtranCellRelation\]')}

Then matching files will be routed to the corresponding properties.

Refer this and this links for more details.

Re: apache Nifi getsftp regex filter??

New Contributor

Thanks a lot @Shu will try and let you know how it went