diff --git a/plugins/inputs/exec/exec.go b/plugins/inputs/exec/exec.go index 68b5055a0..e297721ba 100644 --- a/plugins/inputs/exec/exec.go +++ b/plugins/inputs/exec/exec.go @@ -101,6 +101,12 @@ func (e *Exec) SetParser(parser parsers.Parser) { } func (e *Exec) Gather(acc telegraf.Accumulator) error { + // Legacy single command support + if e.Command != "" { + e.Commands = append(e.Commands, e.Command) + e.Command = "" + } + e.errChan = make(chan error, len(e.Commands)) e.wg.Add(len(e.Commands))