Add Supervisor::{stdout,stderr}_hook

These allow capturing/handling the stdout/stderr of child processes
via Zeek scripts.
This commit is contained in:
Jon Siwek 2020-07-07 20:21:32 -07:00
parent a06ef66edc
commit 10709c627b
8 changed files with 164 additions and 9 deletions

View file

@ -117,4 +117,28 @@ export {
## It's an error to call this function from a process other than
## a supervised one.
global node: function(): NodeConfig;
## Hooks intercepted stdout stream for all supervisor's child processes.
##
## node: the name of a previously created node via
## :zeek:see:`Supervisor::create` indicating to which
## child process the stdout line is associated.
## An empty value is used to indicate the message
## came from the internal supervisor stem process
## (this should typically never happen).
##
## msg: line-buffered contents from the stdout of a child process.
global stdout_hook: hook(node: string, msg: string);
## Hooks intercepted stderr stream for all supervisor's child processes.
##
## node: the name of a previously created node via
## :zeek:see:`Supervisor::create` indicating to which
## child process the stdout line is associated.
## A empty value is used to indicate the message
## came from the internal supervisor stem process.
## (this should typically never happen).
##
## msg: line-buffered contents from the stderr of a child process.
global stderr_hook: hook(node: string, msg: string);
}