-
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
Disable useless HTML escaping when marshaling JSON #2581
Labels
Comments
+1 |
Anyone wants to open a PR for it? :-D |
ruflin
added a commit
to ruflin/beats
that referenced
this issue
May 23, 2017
By default the golang JSON Marshaller escapes HTML entries. As this is not required for beats this is disabling this option. * Unification of json marshalling Closes elastic#2581
+1 |
Here's another Discuss issue where this led to confusion. https://discuss.elastic.co/t/filebeat-character-encoding-problem/136486 |
+1 (data integrity) |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go's HTML marshaler escapes ampersand and angle brackets by default, i.e.
becomes this:
This is done to keep browsers from interpreting the JSON text as HTML, but that's hardly useful in the Beats case. Go 1.7 introduced an option to disable this kind of escaping (see json.Encoder.SetEscapeHTML), and now that Beats has switched to Go 1.7 we might as well disable this behavior. This should have a marginally positive performance impact and could decrease the payload size at least when compression is disabled.
See also https://discuss.elastic.co/t/beats-encodes-angle-brackets-and-as-u003c-and-u003e-in-json-output/60667.
The text was updated successfully, but these errors were encountered: