I'm doing cat vouch.log | while read line; do echo $line; echo $line | jq .message; done and am routinely getting errors from jq like parse error: Invalid numeric literal at line 1, column 225. The errors are actually misleading since it's not about numeric literals at all. The problem is log entries "POST request" often don't have properly escaped "body". I believe this line is to blame: https://github.com/attestantio/go-eth2-client/blob/23b592ca8bd919404d8ebe4860a60939c4ae53a3/http/http.go#L50 as it doesn't escape " or any other special characters. I think piping it through json.Marshal(...) would do the trick.
Hi,
I'm doing
cat vouch.log | while read line; do echo $line; echo $line | jq .message; done
and am routinely getting errors from jq likeparse error: Invalid numeric literal at line 1, column 225
. The errors are actually misleading since it's not about numeric literals at all. The problem is log entries"POST request"
often don't have properly escaped"body"
. I believe this line is to blame: https://github.com/attestantio/go-eth2-client/blob/23b592ca8bd919404d8ebe4860a60939c4ae53a3/http/http.go#L50 as it doesn't escape"
or any other special characters. I think piping it throughjson.Marshal(...)
would do the trick.Thanks!