diff --git a/orbit/changes/osquery-runner-withstdout b/orbit/changes/osquery-runner-withstdout new file mode 100644 index 0000000000..18b102bb23 --- /dev/null +++ b/orbit/changes/osquery-runner-withstdout @@ -0,0 +1 @@ +* Add WithStdout option for osquery's Runner diff --git a/orbit/pkg/osquery/osquery.go b/orbit/pkg/osquery/osquery.go index 92e47f595d..2c51df894f 100644 --- a/orbit/pkg/osquery/osquery.go +++ b/orbit/pkg/osquery/osquery.go @@ -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 {