Avro tools tojson
command escapes binary values. Here's an example:
{"bytes":"\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0000\u0002@ol\u0000\u0000\u0000\u0000\u0000@f¸\u0000\u0000\u0000\u0000\u0000@o¦\u0000\u0000\u0000\u0000\u0000@fú\u0000\u0000\u0000\u0000\u0000"}
How can I extract these binary values to file in bash? Is it possible using jq
?
jq's -r command-line option converts a JSON string to its "raw" form, so to convert the string in .bytes
, you could pipe the JSON to:
jq -r .bytes
The occurrence of NULs in your sample makes it impossible to show the output here on SO.