-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Winlogbeat escaping CRLF sequences #11357
Conversation
Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters which are expected in Windows event logs. Fixes elastic#11328
winlogbeat/sys/event_test.go
Outdated
if !assert.NoError(t, err) { | ||
assert.Equal(t, err.Error(), "XML syntax error on line 6: illegal character code U+001B") | ||
} | ||
evXML := strings.Replace(allXML, "%1", "
\n\x1b", -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think including other whitespace characters would be good too since \t
is used a lot in event logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the story with the \r
? I see you had to use 
. Is it because of https://www.w3.org/TR/REC-xml/#sec-line-ends?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the XML parser was getting rid of it.
self.assertNotIn("event.original", evts[0], evts[0]) | ||
self.assertIn("message", evts[0], evts[0]) | ||
self.assertNotIn("\\u000a", evts[0]["message"]) | ||
self.assertEqual(unicode(msg), evts[0]["message"].decode('unicode-escape'), evts[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to read some python docs before I can fully understand this stuff. But I get the gist.
jenkins, test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters which are expected in Windows event logs. Fixes elastic#11328 (cherry picked from commit 6865403)
Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters which are expected in Windows event logs. Fixes elastic#11328 (cherry picked from commit 6865403)
Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters which are expected in Windows event logs. Fixes elastic#11328 (cherry picked from commit 6865403)
Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters which are expected in Windows event logs. Fixes elastic#11328 (cherry picked from commit 6865403)
The new system test added in elastic#11357 checks for the wrong field in 6.7 and 6.6.
The new system test added in #11357 checks for the wrong field in 6.7 and 6.6.
The new system test added in elastic#11357 checks for the wrong field in 6.7 and 6.6.
…ces (elastic#11370) Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters which are expected in Windows event logs. Fixes elastic#11328 (cherry picked from commit 5db0f15)
…ces (elastic#11372) Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters which are expected in Windows event logs. Fixes elastic#11328 (cherry picked from commit 6865403)
Previous fix (#11006) made Winlogbeat escape CRLF control characters, which are expected in Windows event logs.
Fixes #11328