Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution
Highlighted

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

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

Accepted Solutions

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

Super 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

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

Super 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

Highlighted

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

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).

Don't have an account?
Coming from Hortonworks? Activate your account here