Test for nil metric before reading tags in logparser

This commit is contained in:
Daniel Nelson 2017-08-15 11:41:58 -07:00
parent 032348c7a5
commit 9bc13f143e
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 2 additions and 2 deletions

View File

@ -254,9 +254,9 @@ func (l *LogParserPlugin) parser() {
for _, parser := range l.parsers {
m, err = parser.ParseLine(entry.line)
if err == nil {
tags := m.Tags()
tags["path"] = entry.path
if m != nil {
tags := m.Tags()
tags["path"] = entry.path
l.acc.AddFields(m.Name(), m.Fields(), tags, m.Time())
}
} else {