Exec
Example Configuration
Exec line
1[sources.my_source_id]
2type = "exec"
1"64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.060 ms"
1{
2 "log": {
3 "data_stream": "stdout",
4 "pid": 5678,
5 "timestamp": "2020-03-13T20:45:38.119Z",
6 "host": "my-host.local",
7 "message": "64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.060 ms"
8 }
9}
Configuration Options
Required Options
mode(required)
The type of exec mechanism.
Type | Syntax | Default | Example |
---|---|---|---|
string | literal | ["scheduled","streaming"] |
command(required)
The command to be run, plus any arguments required.
Type | Syntax | Default | Example |
---|---|---|---|
array | literal | [["echo","Hello World!"],["ls","-la"]] |
type(required)
The component type. This is a required field for all components and tells Vector which component to use.
Type | Syntax | Default | Example |
---|---|---|---|
string | literal | ["exec"] |
Advanced Options
working_directory(optional)
The directory in which to run the command.
Type | Syntax | Default | Example |
---|---|---|---|
string | literal |
include_stderr(optional)
Include the output of stderr when generating events.
Type | Syntax | Default | Example |
---|---|---|---|
bool |
event_per_line(optional)
Determine if events should be generated per line or buffered and output as a single event when script execution finishes.
Type | Syntax | Default | Example |
---|---|---|---|
bool |
maximum_buffer_size_bytes(optional)
The maximum buffer size allowed before a log event will be generated.
Type | Syntax | Default | Example |
---|---|---|---|
uint | 1000000 |
scheduled(optional)
The scheduled options.
Type | Syntax | Default | Example |
---|---|---|---|
hash | [] |
streaming(optional)
The streaming options.
Type | Syntax | Default | Example |
---|---|---|---|
hash | [] |
How it Works
Line Delimiters
Each line is read until a new line delimiter, the 0xA
byte, is found or the end of the
maximum_buffer_size_bytes
is reached.
State
This component is stateless, meaning its behavior is consistent across each input.
Context
By default, the exec
source augments events with helpful
context keys.