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 72a235d commit b9ec94f
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 b9ec94f

Please sign in to comment.