Return an error if no valid patterns. (#2753)

This commit is contained in:
Daniel Nelson
2017-05-02 14:54:38 -07:00
committed by GitHub
parent 188703e204
commit f7f1eaef65
3 changed files with 12 additions and 14 deletions

View File

@@ -117,16 +117,11 @@ func (l *LogParserPlugin) Start(acc telegraf.Accumulator) error {
}
// compile log parser patterns:
var haveError bool
for _, parser := range l.parsers {
if err := parser.Compile(); err != nil {
acc.AddError(err)
haveError = true
return err
}
}
if haveError {
return nil
}
l.wg.Add(1)
go l.parser()