blob: ad7cc72f3444cee4427f1d05e8a8350e945e336a [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>ExecuteStreamCommand</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">ExecuteStreamCommand</h1><h2>Description: </h2><p>Executes an external command on the contents of a flow file, and creates a new flow file with the results of the command.</p><h3>Tags: </h3><p>command execution, command, stream, execute</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name">Command Arguments Strategy</td><td>argumentsStrategy</td><td id="default-value">Command Arguments Property</td><td id="allowable-values"><ul><li>Command Arguments Property</li><li>Dynamic Property Arguments</li></ul></td><td id="description">Strategy for configuring arguments to be supplied to the command.</td></tr><tr><td id="name">Command Arguments</td><td>Command Arguments</td><td></td><td id="allowable-values"></td><td id="description">The arguments to supply to the executable delimited by the ';' character.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>Command Path</strong></td><td>Command Path</td><td></td><td id="allowable-values"></td><td id="description">Specifies the command to be executed; if just the name of an executable is provided, it must be in the user's environment PATH.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name">Ignore STDIN</td><td>Ignore STDIN</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">If true, the contents of the incoming flowfile will not be passed to the executing command</td></tr><tr><td id="name">Working Directory</td><td>Working Directory</td><td></td><td id="allowable-values"></td><td id="description">The directory to use as the current working directory when executing the command<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>Argument Delimiter</strong></td><td>Argument Delimiter</td><td id="default-value">;</td><td id="allowable-values"></td><td id="description">Delimiter to use to separate arguments for a command [default: ;]. Must be a single character</td></tr><tr><td id="name">Output Destination Attribute</td><td>Output Destination Attribute</td><td></td><td id="allowable-values"></td><td id="description">If set, the output of the stream command will be put into an attribute of the original FlowFile instead of a separate FlowFile. There will no longer be a relationship for 'output stream' or 'nonzero status'. The value of this property will be the key for the output attribute.</td></tr><tr><td id="name">Max Attribute Length</td><td>Max Attribute Length</td><td id="default-value">256</td><td id="allowable-values"></td><td id="description">If routing the output of the stream command to an attribute, the number of characters put to the attribute value will be at most this amount. This is important because attributes are held in memory and large attributes will quickly cause out of memory issues. If the output goes longer than this value, it will truncated to fit. Consider making this smaller if able.</td></tr></table><h3>Dynamic Properties: </h3><p>Supports Sensitive Dynamic Properties: <strong>Yes</strong></p><p>Dynamic Properties allow the user to specify both the name and value of a property.<table id="dynamic-properties"><tr><th>Name</th><th>Value</th><th>Description</th></tr><tr><td id="name">An environment variable name</td><td id="value">An environment variable value</td><td>These environment variables are passed to the process spawned by this Processor<br/><strong>Supports Expression Language: false</strong></td></tr><tr><td id="name">command.argument.&lt;NUMBER&gt;</td><td id="value">Argument to be supplied to the command</td><td>These arguments are supplied to the process spawned by this Processor when using the Command Arguments Strategy : Dynamic Property Arguments. The NUMBER will determine the order.<br/><strong>Supports Expression Language: false</strong></td></tr></table></p><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>output stream</td><td>The destination path for the flow file created from the command's output, if the returned status code is zero.</td></tr><tr><td>nonzero status</td><td>The destination path for the flow file created from the command's output, if the returned status code is non-zero. All flow files routed to this relationship will be penalized.</td></tr><tr><td>original</td><td>The original FlowFile will be routed. It will have new attributes detailing the result of the script execution.</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>execution.command</td><td>The name of the command executed</td></tr><tr><td>execution.command.args</td><td>The semi-colon delimited list of arguments. Sensitive properties will be masked</td></tr><tr><td>execution.status</td><td>The exit status code returned from executing the command</td></tr><tr><td>execution.error</td><td>Any error messages returned from executing the command</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3><table id="restrictions"><tr><th>Required Permission</th><th>Explanation</th></tr><tr><td>execute code</td><td>Provides operator the ability to execute arbitrary code assuming all permissions that NiFi has.</td></tr></table><h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3>None specified.</body></html>