Allow dos line endings in tail and logparser (#2920)

Parsing dos line ending delimited line protocol is still illegal in most
cases.
This commit is contained in:
Daniel Nelson
2017-06-16 13:16:48 -07:00
committed by GitHub
parent 148f81682a
commit 6bbed7aa90
3 changed files with 46 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package tail
import (
"fmt"
"strings"
"sync"
"github.com/influxdata/tail"
@@ -123,7 +124,10 @@ func (t *Tail) receiver(tailer *tail.Tail) {
tailer.Filename, err))
continue
}
m, err = t.parser.ParseLine(line.Text)
// Fix up files with Windows line endings.
text := strings.TrimRight(line.Text, "\r")
m, err = t.parser.ParseLine(text)
if err == nil {
t.acc.AddFields(m.Name(), m.Fields(), m.Tags(), m.Time())
} else {