Created 02-22-2017 09:55 PM
Trying to move files via Nifi using GetSFTP. Let's say the filename is "DATA1". I want to move DATA1 into HDFS directory DATA1. I also want to do this with DATA2, DATA3, etc... How would this be possible via Nifi without creating a process for each file?
Created 02-22-2017 10:03 PM
Use expression language in PutHDFS for the value of the Directory property, so setting it to ${filename} would put each file into a directory named the same as the filename attribute of each flow file in NiFi.
Created 02-22-2017 10:03 PM
Use expression language in PutHDFS for the value of the Directory property, so setting it to ${filename} would put each file into a directory named the same as the filename attribute of each flow file in NiFi.
Created 02-22-2017 10:16 PM
Thanks, this is exactly what I'm looking for!
Created on 02-22-2017 10:08 PM - edited 08-19-2019 03:34 AM
Yes this is very doable...
NiFi automatically creates a FlowFile Attribute called "filename" on every FlowFile that is created. You can use this existing attribute to specify teh target HDFS directory:
Of course you will want to modify the above for the complete target path.
Thanks,
Matt