Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify output filename with PutFile processor

Tags:

apache-nifi

Background

I have a workflow that uses a FetchFile processor, some intermediary processors (e.g. RouteOnAttribute, HashContent, etc.), and then a PutFile processor.

Throughout it all, the content is not being manipulated.

Issue/Problem

The PutFile processor is saving files using a timestamp, NOT the original filename.

Question

How can I either:

  1. Get the PutFile processor to use the original filename? or
  2. Specify the filename that the PutFile processor will use?
like image 436
Dan Avatar asked Sep 05 '17 16:09

Dan


1 Answers

The PutFile processor will save the content in a file with the filename based on the filename attribute on the flowfile. You can use an UpdateAttribute processor to provide whatever value you like for this attribute.

GetFile will read the original filename of the file on disk into this attribute, but because FetchFile expects the filename as an incoming attribute on the flowfile, it does not write the value back as an attribute.

like image 155
Andy Avatar answered Sep 22 '22 09:09

Andy