Skip to content
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

Merged
merged 4 commits into from
Mar 21, 2019

Conversation

adriansr
Copy link
Contributor

Previous fix (#11006) made Winlogbeat escape CRLF control characters, which are expected in Windows event logs.

Fixes #11328

Previous fix (elastic#11006) made Winlogbeat escape CRLF control characters
which are expected in Windows event logs.

Fixes elastic#11328
@adriansr adriansr requested a review from a team as a code owner March 21, 2019 03:12
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)
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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])
Copy link
Member

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.

@adriansr
Copy link
Contributor Author

jenkins, test this

@adriansr adriansr added bug Winlogbeat needs_backport PR is waiting to be backported to other branches. labels Mar 21, 2019
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@adriansr adriansr merged commit 6865403 into elastic:master Mar 21, 2019
adriansr added a commit to adriansr/beats that referenced this pull request Mar 21, 2019
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)
@adriansr adriansr added v6.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Mar 21, 2019
adriansr added a commit that referenced this pull request Mar 21, 2019
Previous fix (#11006) made Winlogbeat escape CRLF control characters
which are expected in Windows event logs.

Fixes #11328

(cherry picked from commit 6865403)
adriansr added a commit to adriansr/beats that referenced this pull request Mar 21, 2019
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)
adriansr added a commit to adriansr/beats that referenced this pull request Mar 21, 2019
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)
adriansr added a commit to adriansr/beats that referenced this pull request Mar 21, 2019
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)
adriansr added a commit that referenced this pull request Mar 21, 2019
Previous fix (#11006) made Winlogbeat escape CRLF control characters
which are expected in Windows event logs.

Fixes #11328

(cherry picked from commit 6865403)
adriansr added a commit that referenced this pull request Mar 22, 2019
…1372)

Previous fix (#11006) made Winlogbeat escape CRLF control characters
which are expected in Windows event logs.

Fixes #11328

(cherry picked from commit 6865403)
adriansr added a commit to adriansr/beats that referenced this pull request Mar 25, 2019
The new system test added in elastic#11357 checks for the wrong field
in 6.7 and 6.6.
adriansr added a commit that referenced this pull request Mar 25, 2019
The new system test added in #11357 checks for the wrong field
in 6.7 and 6.6.
adriansr added a commit to adriansr/beats that referenced this pull request Mar 25, 2019
The new system test added in elastic#11357 checks for the wrong field
in 6.7 and 6.6.
adriansr added a commit that referenced this pull request Mar 28, 2019
…1370)

Previous fix (#11006) made Winlogbeat escape CRLF control characters
which are expected in Windows event logs.

Fixes #11328

(cherry picked from commit 6865403)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…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)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

winlogbeat 6.6.2 sends utf-16 control codes (carriage return, line feed, tab)
2 participants