ExecuteProcess

Description:

Runs an operating system command specified by the user and writes the output of that command to a FlowFile. If the command is expected to be long-running, the Processor can output the partial data on a specified interval. When this option is used, the output is expected to be in textual format, as it typically does not make sense to split binary data on arbitrary time-based intervals.

Tags:

command, process, source, external, invoke, script

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
CommandCommandSpecifies the command to be executed; if just the name of an executable is provided, it must be in the user's environment PATH.
Supports Expression Language: true (will be evaluated using variable registry only)
Command ArgumentsCommand ArgumentsThe arguments to supply to the executable delimited by white space. White space can be escaped by enclosing it in double-quotes.
Supports Expression Language: true (will be evaluated using variable registry only)
Batch DurationBatch DurationIf the process is expected to be long-running and produce textual output, a batch duration can be specified so that the output will be captured for this amount of time and a FlowFile will then be sent out with the results and a new FlowFile will be started, rather than waiting for the process to finish before sending out the results
Redirect Error StreamRedirect Error Streamfalse
  • true
  • false
If true will redirect any error stream output of the process to the output stream. This is particularly helpful for processes which write extensively to the error stream or for troubleshooting.
Working DirectoryWorking DirectoryThe directory to use as the current working directory when executing the command
Supports Expression Language: true (will be evaluated using variable registry only)
Argument DelimiterArgument Delimiter Delimiter to use to separate arguments for a command [default: space]. Must be a single character.

Dynamic Properties:

Supports Sensitive Dynamic Properties: No

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
An environment variable nameAn environment variable valueThese environment variables are passed to the process spawned by this Processor
Supports Expression Language: false

Relationships:

NameDescription
successAll created FlowFiles are routed to this relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
commandExecuted command
command.argumentsArguments of the command

State management:

This component does not store state.

Restricted:

Required PermissionExplanation
execute codeProvides operator the ability to execute arbitrary code assuming all permissions that NiFi has.

Input requirement:

This component does not allow an incoming relationship.

System Resource Considerations:

None specified.