Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How do you run cmd commands for NiFi to execute processors?

avatar

Hi, I am trying to figure out how to run command line (cmd) commands within Apache NiFi so that I can trigger or execute processors from the command line.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@TRACEY JACKSON

NiFi processors are configurable to run using a Timer Driven or Cron Driven scheduling strategy. This scheduling can uniquely configured per each processors configuration. Processors are then started and the operate based on the configured scheduler from that point forward.

-

The NiFi API can be used to perform any action a user can perform directly from the UI. The best way to learn the rest-api calls is to use the "Developer tools" available via most browsers.
-

While focused on tab where NiFi UI is open, launch the developers tools.

Chrome Browser example:

107352-screen-shot-2019-03-21-at-94520-am.png

107371-screen-shot-2019-03-21-at-94854-am.png

Then perform the action via the NiFi UI and you will see the "Network" call display in list.

You can right click on that call and select "Copy as curl".
Now you have an example of how to execute that same request via command line.

107372-screen-shot-2019-03-21-at-95243-am.png

-

For more info in the NIFi rest-api, you can look in "help" found within the NiFi UI Global menu (upper right corner). The Rest Api documentation can be found in the "Developer" section at bottom of list on far left side of help UI.

-

The danger with trying to "run" dataflows in NiFi via command line is you may end up stopping processors in the dataflow chain that results in FlowFile being unprocessed and sitting on connection queues between processors.

-

Thank you,
Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.


View solution in original post

1 REPLY 1

avatar
Master Mentor

@TRACEY JACKSON

NiFi processors are configurable to run using a Timer Driven or Cron Driven scheduling strategy. This scheduling can uniquely configured per each processors configuration. Processors are then started and the operate based on the configured scheduler from that point forward.

-

The NiFi API can be used to perform any action a user can perform directly from the UI. The best way to learn the rest-api calls is to use the "Developer tools" available via most browsers.
-

While focused on tab where NiFi UI is open, launch the developers tools.

Chrome Browser example:

107352-screen-shot-2019-03-21-at-94520-am.png

107371-screen-shot-2019-03-21-at-94854-am.png

Then perform the action via the NiFi UI and you will see the "Network" call display in list.

You can right click on that call and select "Copy as curl".
Now you have an example of how to execute that same request via command line.

107372-screen-shot-2019-03-21-at-95243-am.png

-

For more info in the NIFi rest-api, you can look in "help" found within the NiFi UI Global menu (upper right corner). The Rest Api documentation can be found in the "Developer" section at bottom of list on far left side of help UI.

-

The danger with trying to "run" dataflows in NiFi via command line is you may end up stopping processors in the dataflow chain that results in FlowFile being unprocessed and sitting on connection queues between processors.

-

Thank you,
Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.