Command source
The command source executes a shell command on a configurable interval and captures each line of stdout as a log event. This is useful for collecting output from custom scripts, system utilities, or any program that writes to stdout.
Configuration
Options
| Option | Type | Default | Description |
|---|---|---|---|
cmd | string | required | Command to execute |
args | string[] | null | Command arguments |
inheritEnv | bool | false | Inherit the reveald process environment |
env | object | null | Environment variables for the command. Overrides inherited env if both are set. |
interval | duration | "5s" | Time between executions. The command must complete within this interval or it will be killed. |
Examples
Run a custom log collection script
Run with custom environment
Event fields
| Field | Value |
|---|---|
sourceType | "command" |
rawLog | Line from stdout |
eventTime | Current time when the line is read |
service.name | The command name |