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

apache Nifi getFTP regex filter?

apache Nifi getFTP regex filter?

New Contributor

I want to import all files that are from A.


I want to import all files with this format [ABC_YYYYMMDD.txt] from FTP.

How should I express [File Filter Regex] field?


ex) abc_20200324.txt


Re: apache Nifi getFTP regex filter?

Master Guru



You could use a Java Regular expression like this:


  The above will match everything before "_" and then must match a number that starts with "20", followed by  to digits "\d\d" (this matches any year in 2001-2099), followed by  "(0[1-9]|1[012])" (this matches months 01-09 or 10,11,12), followed by "(0[1-9]|[12][0-9]|3[01])" (this matches days 01-09 or 10-29 or 30 or 31), ending with the text string ".txt".


There are some good regex testers available on the web you may find useful.


Hope this helps,



Don't have an account?
Coming from Hortonworks? Activate your account here