Ignore empty lines in Graphite plaintext (#3684)
This commit is contained in:
parent
72a235d9cf
commit
b9ec94f181
|
@ -86,8 +86,11 @@ func (p *GraphiteParser) Parse(buf []byte) ([]telegraf.Metric, error) {
|
||||||
|
|
||||||
// Trim the buffer, even though there should be no padding
|
// Trim the buffer, even though there should be no padding
|
||||||
line := strings.TrimSpace(string(buf))
|
line := strings.TrimSpace(string(buf))
|
||||||
metric, err := p.ParseLine(line)
|
if line == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
metric, err := p.ParseLine(line)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
metrics = append(metrics, metric)
|
metrics = append(metrics, metric)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue