jq
jq is a command-line tool for processing JSON data.
Filter a list of JSON object based on a list of tags
Use the
arraysfilter to remove empty values, theany(…)filter to check for set inclusion, then wrap the whole thing in square brackets.Get a map of IP addresses for devices in my tailnet
Use
tailscale status --jsonand filter the output usingjq.Get a list of values in a JSON object with jq
The equivalent to Python’s
dict.values()isjq '[.[]]'.How to get the IP address of a device in my Tailnet
Use
tailscale status --jsonand filter the output usingjq.Filtering AWS CLI output by tags using jq
Using
from_entriesis a nicer way to deal with the list of Name/Value pairs returned by the AWS CLI.Experimenting with jq as a tool for filtering JSON
I wanted to learn jq’s more powerful features, so I tried to filter some JSON from the AWS Secrets Manager CLI.