fix(inputs.syslog): print error when no error or message given (#11997)

This commit is contained in:
Joshua Powers 2022-10-12 14:54:27 -05:00 committed by GitHub
parent ee3bc36c1e
commit 6fa06d4405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -209,6 +209,9 @@ func (s *Syslog) listenPacket(acc telegraf.Accumulator) {
if err != nil {
acc.AddError(err)
}
if err == nil && message == nil {
acc.AddError(fmt.Errorf("unable to parse message: %s", string(b[:n])))
}
}
}