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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user