Stream
A Stream is an ASCII or UTF-8 text stream, typically logs.
cmd
An array of strings. The first string is the command, and the subsequent strings are the arguments.
reaction will execute the command to fetch the text stream.
Command's stdout and stderr are read and treated equally by reaction.
See FAQ "Why start, stop, stream and action commands are arrays" for an explanation.
See Streams for details on how to write correct Stream commands for reaction.
{
streams: {
ssh: {
cmd: ['journalctl', '-f', '-n0', ...],
},
nginx: {
cmd: ['tail', '-F', '-n0', ...],
},
},
}streams:
ssh:
cmd: ['journalctl', '-f', '-n0', ...]
web:
cmd: ['tail', '-F', '-n0', ...]type
Available since v2.3.0.
Defaults to "cmd", in which case a cmd must be provided.
{
streams: {
stream1: {
type: "cmd",
cmd: [...],
}
}
}streams:
stream1:
type: cmd
cmd: [...]
Otherwise, defines the Plugin that will be used for that Stream.
options
Available since v2.3.0.
Used in conjunction with type.
The value of options depends on the Plugin selected, see their documentation.
{
streams: {
stream1: {
type: "plugin1",
options: {
option1: "value1",
...
}
}
}
}streams:
stream1:
type: cmd
options:
option1: value1
...filters
We must attach one or more Filters to a Stream.
{
streams: {
ssh: {
cmd: ['journalctl', '-f', '-n0', ...],
filters: {
myfilter: {
...
},
myotherfilter: {
...
},
},
},
nginx: {
cmd: ['tail', '-F', '-n0', ...],
filters: {
...
},
},
},
}streams:
ssh:
cmd: ['journalctl', '-f', '-n0', ...]
filters:
myfilter:
...
myotherfilter:
...
web:
cmd: ['tail', '-F', '-n0', ...]
filters:
...