Fix parsing of SHM remotes in ntpq input (#3163)

This commit is contained in:
Jan Willem Janssen
2017-08-25 20:54:06 +02:00
committed by Daniel Nelson
parent 58751fa4df
commit d449833de9
2 changed files with 54 additions and 1 deletions

View File

@@ -69,7 +69,7 @@ func (n *NTPQ) Gather(acc telegraf.Accumulator) error {
// Due to problems with a parsing, we have to use regexp expression in order
// to remove string that starts from '(' and ends with space
// see: https://github.com/influxdata/telegraf/issues/2386
reg, err := regexp.Compile("\\([\\S]*")
reg, err := regexp.Compile("\\s+\\([\\S]*")
if err != nil {
return err
}