Skip to content

Commit

Permalink
Ignore empty lines in Graphite plaintext (#3684)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahcrowley authored and danielnelson committed Jan 16, 2018
1 parent d188b78 commit 87830a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/parsers/graphite/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ func (p *GraphiteParser) Parse(buf []byte) ([]telegraf.Metric, error) {

// Trim the buffer, even though there should be no padding
line := strings.TrimSpace(string(buf))
metric, err := p.ParseLine(line)
if line == "" {
continue
}

metric, err := p.ParseLine(line)
if err == nil {
metrics = append(metrics, metric)
} else {
Expand Down

0 comments on commit 87830a1

Please sign in to comment.