You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
7
7
8
8
### Added
9
9
10
+
- The `command` processor now emits the `exit_code` metadata field. (@mihaitodor)
10
11
- Go API: `Message` now exposes `MetaGetImmut` and `MetaSetImmut` methods for reading and writing metadata values of any type with immutable semantics. (@Jeffail)
The specified command is executed for each message processed, with the raw bytes of the message being fed into the stdin of the command process, and the resulting message having its contents replaced with the stdout of it.
28
28
29
+
== Metadata
30
+
31
+
This input adds the following metadata fields to each message:
32
+
33
+
`+"```text"+`
34
+
- command_stderr - Contains the stderr output of a successful command, if any.
35
+
- exit_code - The exit code returned by the command.
Since this processor executes a new process for each message performance will likely be an issue for high throughput streams. If this is the case then consider using the xref:components:processors/subprocess.adoc[`+"`subprocess` processor"+`] instead as it keeps the underlying process alive long term and uses codecs to insert and extract inputs and outputs to it via stdin/stdout.
32
44
33
45
== Error handling
34
46
35
47
If a non-zero error code is returned by the command then an error containing the entirety of stderr (or a generic message if nothing is written) is set on the message. These failed messages will continue through the pipeline unchanged, but can be dropped or placed in a dead letter queue according to your config, you can read about xref:configuration:error_handling.adoc[these patterns].
36
-
37
-
If the command is successful but stderr is written to then a metadata field `+"`command_stderr`"+` is populated with its contents.
0 commit comments