Keep leading whitespace for messages in syslog input (#4498)

This commit is contained in:
Daniel Nelson
2018-07-31 17:15:42 -07:00
committed by Greg
parent ddf2d691e9
commit 6a32a7d85b
3 changed files with 40 additions and 5 deletions

View File

@@ -202,6 +202,38 @@ func getTestCasesForRFC5426() []testCase5426 {
},
werr: true,
},
{
name: "trim message",
data: []byte("<1>1 - - - - - - \tA\n"),
wantBestEffort: &testutil.Metric{
Measurement: "syslog",
Fields: map[string]interface{}{
"version": uint16(1),
"message": "\tA",
"facility_code": 0,
"severity_code": 1,
},
Tags: map[string]string{
"severity": "alert",
"facility": "kern",
},
Time: defaultTime,
},
wantStrict: &testutil.Metric{
Measurement: "syslog",
Fields: map[string]interface{}{
"version": uint16(1),
"message": "\tA",
"facility_code": 0,
"severity_code": 1,
},
Tags: map[string]string{
"severity": "alert",
"facility": "kern",
},
Time: defaultTime,
},
},
}
return testCases