= subprocess
:type: output
:status: beta
:categories: ["Utility"]



////
     THIS FILE IS AUTOGENERATED!

     To make changes, edit the corresponding source file under:

     https://github.com/redpanda-data/connect/tree/main/internal/impl/<provider>.

     And:

     https://github.com/redpanda-data/connect/tree/main/cmd/tools/docs_gen/templates/plugin.adoc.tmpl
////

// © 2024 Redpanda Data Inc.


component_type_dropdown::[]


Executes a command, runs it as a subprocess, and writes messages to it over stdin.

```yml
# Config fields, showing default values
output:
  label: ""
  subprocess:
    name: "" # No default (required)
    args: []
    codec: lines
```

Messages are written according to a specified codec. The process is expected to terminate gracefully when stdin is closed.

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.

The execution environment of the subprocess is the same as the Benthos instance, including environment variables and the current working directory.

== Fields

=== `name`

The command to execute as a subprocess.


*Type*: `string`


=== `args`

A list of arguments to provide the command.


*Type*: `array`

*Default*: `[]`

=== `codec`

The way in which messages should be written to the subprocess.


*Type*: `string`

*Default*: `"lines"`

Options:
`lines`
.


