Support Questions

Find answers, ask questions, and share your expertise

File to Fetch property in FetchFile processor

avatar
Contributor

I need some help in giving the file name path in FetchFile processor. I am filling the full path of the file inside quotes and then after $, providing the exact filename with extension. Still the processor could not identify the file. Kindly help.

3 REPLIES 3

avatar
Master Guru

@Bharath Sudharsanam

Fetch File processor works in conjunction with List file processor as list file processor adds

${absolute.path,${filename}

attributes to the flowfiles then Fetch File processor fetches those files.

If you are not using ListFile processor then you need to having fully qualified file path to be mentioned in the File to Fetch property value and this processor needs an upstream connection to trigger.

Example:

I want to fetch file_fetch.txt file from temp directory then Fetch File configs:

85559-fetchfile.png

Now FetchFile processor will fetches this file_fetch.txt from temp directory and transfers to success relationship.

If you are having file_path attribute with value as /temp/file_fetch.txt associated with the flowfile then Configs:

85560-fetchfile.png

Now the processor checks the attribute value and dynamically fetches the files from the directory if NiFi have access to those directories.

Flow:

As this processor expects upstream connection and i'm not using ListFile processor instead i use GenerateFLowfile (added file_path attiribute) processor to trigger Fetch File processor (or) you can simply use ListFile + FetchFile processors also.

85561-flow.png

avatar
Contributor

Yes. I understand. I see the absolute path and the correct file name identified by the ListFile Processor. If that is the case, Can I leave the File to Fetch property in FetchFile processor as such? I mean $(absolute.path}/${filename}?

avatar
Master Guru
@Bharath Sudharsanam

Yes, leave the Fetch File processor property as default. processor will fetches those files from the directory.