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:
jarnpher_rice
2022-05-31 14:36:19 -03:00
committed by GitHub
parent 1da9425869
commit 348c67d932
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
* Add WithStdout option for osquery's Runner
+8
View File
@@ -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 {