Edge Delta Execs Input
2 minute read
See the latest version here.
Overview
You can configure the Edge Delta agent to consume the output from an executed command or script. If the command fails (non-zero exit code) its output will be ignored. Upon successful execution, each line of stdout
will be ingested to the system separately.
Example
inputs:
execs:
- name: "welcomes"
labels: "script"
interval: 10s
command: "/bin/sh -c"
script: |
for i in {1..50}
do
echo "Welcome $i times"
done
Example Output
With this configuration applied, the following example log could be delivered.
{
"_timestamp": 1680273817779,
"_type": "log",
"_raw": "Welcome 1 times",
"_ed": {
"config_id": "123456789",
"__group_name": "site1-env|stat|site1-agent|Exec|exec_input",
"host": "site1-agent",
"ip": "123.456.789",
"__logical_source": "Exec,site1-env|stat|site1-agent|Exec|exec_input",
"__short_src_name": "exec_input",
"__src_name": "site1-env|stat|site1-agent|Exec|exec_input",
"src_type": "Exec",
"tag": "site1-env"
}
}
Required Parameters
name
The name
parameter specifies the name for the executable. Names must be unique within the inputs:
section. It is specified as a string. A name is a required parameter for an Exec source.
inputs:
execs:
- name: "<executable name>"
labels
The labels
parameter specifies one or more names for the input. You refer to one of these labels in other places, for example to refer to a specific input in a workflow. Labels must be unique within the inputs section. It is a string. A label is required for an input.
inputs:
execs:
- name: "<executable name>"
labels: "<label>"
command
The command
parameter defines the command to execute and it can optionally launch bash to execute a script. A command is a required field for an exec
input.
inputs:
execs:
- name: "<executable name>"
labels: "<label>"
command: "<executable commands>"
interval
The interval
parameter defines the interval to wait between executing the command. It is specified as a duration. An interval is a required field for an exec
input.
inputs:
execs:
- name: "<executable name>"
labels: "<label>"
command: "<executable commands>"
interval: <duration>
Optional Parameters
script
The script
parameter defines the bash script that is executed by the command parameter. It is specified as a shell executable. A script is optional for an exec
input.
inputs:
execs:
- name: "<executable name>"
labels: "<label>"
command: "<executable commands>"
interval: <duration>
script: |
for i in {1..50}
do
echo "Welcome $i times"
done