Support Questions

Find answers, ask questions, and share your expertise

How to execute a shell script while using NiFi in Windows?

avatar
Rising Star

I'm using windows NiFi and i need to perform shell action which is installed in same server's VM. Is their any process available to execute the shell script .

Thanks all

1 ACCEPTED SOLUTION

avatar
Rising Star

If you are referring to a batch or PowerShell script, this can be accomplished via ExecuteProcess [1] or ExecuteStreamCommand [2]. Both will allow you to execute processes on your host environment and collect its output to stdout from the execution in a resultant FlowFile for further processing. ExecuteStreamCommand additionally allows you to take an incoming FlowFile and pipe its content across stdin to the associated process.

[1] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.6.0/org.apache...   

[2] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.ExecuteStreamC...

View solution in original post

2 REPLIES 2

avatar
Rising Star

If you are referring to a batch or PowerShell script, this can be accomplished via ExecuteProcess [1] or ExecuteStreamCommand [2]. Both will allow you to execute processes on your host environment and collect its output to stdout from the execution in a resultant FlowFile for further processing. ExecuteStreamCommand additionally allows you to take an incoming FlowFile and pipe its content across stdin to the associated process.

[1] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.6.0/org.apache...   

[2] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.ExecuteStreamC...

avatar
New Contributor

It will be great if you can help with examples for running powershell scripts.It would be a great help to me