Created 04-13-2017 08:13 PM
I am trying to fetch a file that has a date time stamp added to the beginning of the filename on a remote server.
like this 2017-13-04_file123.txt.gz
And I know the file is named file123.txt
I have tried doing this as the remote filename fetch: /home/user/*${FileToFetch}*
Where FileToFetch is file123.txt
There is no way for me to assume that the filename will start with a specific date or for me to know the file extention.
Created 04-13-2017 11:54 PM
Created 04-17-2017 12:50 PM
That's not quite what I'm looking for.
I know the the filename on the REMOTE system contains file123.txt.
There may be any nubmber of random characters of numbers preceding or proceeding "file123.txt"
Adding contains wont work because I need the remote file fetch to get all files that have file123.txt in the filename.
Not have nifi look to see if the attribute contains something.
John
Created 04-20-2017 03:34 PM
Try using this for the Remote File property /home/user/.*${FileToFetch}.*
The ".*" says any character, any number of characters. So for your example, it will grab any file that contains "file123.txt" anywhere in the name.
Created 04-20-2017 03:43 PM
If you are using the listSFTP processor before your FetchSFTP processor , it will produce a zero byte flow flowfile for every FlowFile it finds on the target SFTP server. The listSFTP processor has a "File Filter Regex" where you can specify a java regular expression to limit what is returned to just files containing "file123.txt". For example "*file123.txt"
The ListSFTP processor also maintains state so that the same files are not listed each time. so only new files containing file123.txt are listed each time it runs.
The FetchSFTp processor is designed to return the content of a specific file and insert it as content to the FlowFile that he FetchSFTP processor is running against.
Thanks,
Matt