I have a json like
{"2xx_count":10,"3xx_count":11}
but, I get errors as followings:
$ echo '{"2xx_count":10,"3xx_count":11}' | jq .2xx_count
error: syntax error, unexpected IDENT, expecting $end
.2xx_count
^^^^^^^^
1 compile error
echo '{"2xx_count":10,"3xx_count":11}' | jq '.["2xx_count"]'
@lluchs thanks!
@lluchs
How to do that with key_name as variable ? For example
cat data.json | jq '.["$1"]'
where $1 is the first paremeter ?
Most helpful comment