You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While processing syslog messages in JSONL format, I came across a logged SSID. SSIDs are notorious for breaking naive tools because they can contain up to 32 arbitrary bytes, not necessarily valid ASCII/UTF-8 strings.
In this instance, the log entry, as written by another tool, valid line-separated JSON, looks like this (formatted for convenience):
Attempting to process this output (I was using mlr to filter logs) fails with a parser error: mlr: invalid character '\x01' in string literal.
Expected Fix
json_stringify()(which I assume is used for output encoding as well) must properly encode control characters, as specified at json.org (string syntax diagram).
While processing syslog messages in JSONL format, I came across a logged SSID. SSIDs are notorious for breaking naive tools because they can contain up to 32 arbitrary bytes, not necessarily valid ASCII/UTF-8 strings.
In this instance, the log entry, as written by another tool, valid line-separated JSON, looks like this (formatted for convenience):
Running
mlr --ijson --ojsonl cat sample_orig.json
yields output that is no longer valid JSON as it contains unescaped control chars.:Attempting to process this output (I was using
mlr
to filter logs) fails with a parser error:mlr: invalid character '\x01' in string literal.
Expected Fix
json_stringify()
(which I assume is used for output encoding as well)must properly encode control characters, as specified at json.org (string syntax diagram).Edit: The bug seems to live here:
miller/pkg/mlrval/mlrval_json.go
Line 355 in 9357458
There is a check and branch missing for values outside of
0x20..=0x10FFFF
.The text was updated successfully, but these errors were encountered: