Return an error if no valid patterns. (#2753)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user