Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Nifi : Pass Parameter dynamically (ex . file path) with nifi REST API

avatar

Hi , I want to pass file path through nifi api and call nifi process, how is possible any alternate way ? Ex: move CSV to hadoop GetFile (want to pass file path through api dyanamicaly) - > PutHDFS

I want to achieve something like below

aa.png

aaa.png

thanks , paresh baldaniya

1 ACCEPTED SOLUTION

avatar
Master Guru

Rather than GetFile, you could use ListenHttp -> FetchFile -> PutHDFS. Then you can POST to your configured endpoint with a header set to the filename, and in ListenHttp set that header name as the value of the "HTTP Headers to receive as Attributes (Regex)" property. Then FetchFile would be configured to use that attribute to fetch the file and pass to PutHDFS.

View solution in original post

2 REPLIES 2

avatar
Master Guru

Rather than GetFile, you could use ListenHttp -> FetchFile -> PutHDFS. Then you can POST to your configured endpoint with a header set to the filename, and in ListenHttp set that header name as the value of the "HTTP Headers to receive as Attributes (Regex)" property. Then FetchFile would be configured to use that attribute to fetch the file and pass to PutHDFS.

avatar

Hi @Matt Burgess, how can we do thos for a csv file..?

for example i am having a csv file(studentid_name_city.csv). I want to break the filename and put it into different columns of Studend table(Studentid,name,city).