@Allen123
Based on your description, the ListSftp processor is working exactly as designed and configured.
You have told it to list file from both directories and have also told it to search for both filenames in those directories. There is no way to configure the processor to ignore the extra unwanted a.text or b.text files.
You have two options:
Option 1:
- Create to listSFTP processor with each configured to list within a unique directory and "Search Recursively" set to false. Then set a "File Filter Regex" so it only lists the desired file from each directory.
- The feed the success relationship from each of those two ListSftp processors to a single FetchSftp processor.
Option2:
The ListSftp processor is designed to only list files and not actually consume any content. The content of the files listed is consumed later using the FetchSftp processor. Between the ListSftp and the FetchSftp processors you could insert a RouteOnAttribute [1] processor that you could configure to only pass the two specific files you want on to FetchSftp while auto-terminating the others.



You would route the matched relationship via a connection to the FetchSFTP and "auto-terminate" the unmatched relationship.
[1] http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache.nifi.processors.standard.RouteOnAttribute/index.html
If you find that this has helped with your query, please take a moment to login and click accept on the solution.
Thanks,
Matt