Fix statsd scientific notation parsing

closes #1733
This commit is contained in:
Cameron Sparr
2016-09-09 15:04:38 +01:00
parent ac58a6bb3c
commit ca8fb440cc
3 changed files with 263 additions and 224 deletions

View File

@@ -416,7 +416,7 @@ func (s *Statsd) parseStatsdLine(line string) error {
}
// Parse the value
if strings.ContainsAny(pipesplit[0], "-+") {
if strings.HasPrefix(pipesplit[0], "-") || strings.HasPrefix(pipesplit[0], "+") {
if m.mtype != "g" {
log.Printf("Error: +- values are only supported for gauges: %s\n", line)
return errors.New("Error Parsing statsd line")