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 71c567fb87
commit 064071ba51
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 {
if m != nil {
tags := m.Tags()
tags["path"] = entry.path
if m != nil {
l.acc.AddFields(m.Name(), m.Fields(), tags, m.Time())
}
} else {