Question:
I’m running this command line json parser (jq) in Debian GNU/Linux 11 (bullseye) to decode the json data:jq -R ‘split(".") | .[0],.[1] | @base64d | fromjson’ <<< eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJleHAiOjE2NTUzODQ4MzJ9.QVevY3qVLWHxfkNX1S4bas6PKSN75Nf96V7WmkcgbrE
Answer:
You don’t need the first object, you can ignore it (remove[0]
). Then just specify which key you want:jq -R ‘split(“.”) | .[1] | @base64d | fromjson | .exp’ <<< ... [/code]
If you have better answer, please add a comment about this, thank you!