github.com/Jeffail/benthos/v3@v3.65.0/website/docs/components/outputs/subprocess.md (about)

     1  ---
     2  title: subprocess
     3  type: output
     4  status: beta
     5  categories: ["Utility"]
     6  ---
     7  
     8  <!--
     9       THIS FILE IS AUTOGENERATED!
    10  
    11       To make changes please edit the contents of:
    12       lib/output/subprocess.go
    13  -->
    14  
    15  import Tabs from '@theme/Tabs';
    16  import TabItem from '@theme/TabItem';
    17  
    18  :::caution BETA
    19  This component is mostly stable but breaking changes could still be made outside of major version releases if a fundamental problem with the component is found.
    20  :::
    21  
    22  Executes a command, runs it as a subprocess, and writes messages to it over stdin.
    23  
    24  ```yaml
    25  # Config fields, showing default values
    26  output:
    27    label: ""
    28    subprocess:
    29      name: ""
    30      args: []
    31      codec: lines
    32  ```
    33  
    34  Messages are written according to a specified codec. The process is expected to terminate gracefully when stdin is closed.
    35  
    36  If the subprocess exits unexpectedly then Benthos will log anything printed to stderr and will log the exit code, and will attempt to execute the command again until success.
    37  
    38  The execution environment of the subprocess is the same as the Benthos instance, including environment variables and the current working directory.
    39  
    40  ## Fields
    41  
    42  ### `name`
    43  
    44  The command to execute as a subprocess.
    45  
    46  
    47  Type: `string`  
    48  Default: `""`  
    49  
    50  ### `args`
    51  
    52  A list of arguments to provide the command.
    53  
    54  
    55  Type: `array`  
    56  Default: `[]`  
    57  
    58  ### `codec`
    59  
    60  The way in which messages should be written to the subprocess.
    61  
    62  
    63  Type: `string`  
    64  Default: `"lines"`  
    65  Options: `lines`.
    66  
    67