Add WithStdout option for osquery's Runner (#5637)
* Add WithStdout option for osquery's Runner fetch the osquery output to do something in other flow * Create osquery-runner-withstdout * Update osquery.go
This commit is contained in:
@@ -0,0 +1 @@
|
||||
* Add WithStdout option for osquery's Runner
|
||||
@@ -115,6 +115,14 @@ func WithStderr(w io.Writer) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithStdout sets the runner's cmd's stdout to the given writer.
|
||||
func WithStdout(w io.Writer) Option {
|
||||
return func(r *Runner) error {
|
||||
r.cmd.Stdout = w
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func WithLogPath(path string) Option {
|
||||
return func(r *Runner) error {
|
||||
if err := secure.MkdirAll(path, constant.DefaultDirMode); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user