-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Influx parser fails to parse but returns no error #2297
Copy link
Copy link
Closed
Milestone
Description
Bug report
package main
import (
"fmt"
"github.com/influxdata/telegraf/plugins/parsers"
)
func main() {
p, _ := parsers.NewInfluxParser()
m, err := p.Parse([]byte("test,foo=bar v=1i 123456789"))
fmt.Printf("err=%v\n", err)
fmt.Printf("m=%#v\n", m)
}Expected behavior:
err=<nil>
m=[]telegraf.Metric{(*metric.metric)(0xc42009a480)}
Actual behavior:
err=<nil>
m=[]telegraf.Metric{}
Additional info:
It parses fine only if there is a trailing newline.
This is a regression. I noticed this while trying to update PR #2094. Code that was previously working is now failing. While I would argue that a trailing newline should not be required to parse, at the very least if it does not parse, it should return an error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels