brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: tailscale status in JSON plus jq answers questions the table cannot

Network and access
~/tips/tip-tailscale-status-json-jq

tailscale status --json | jq -r '.Peer[] | select(.Online == false) | .HostName'

Filter your device list with jq, for example to list every offline machine.

The normal tailscale status table is fine for a glance. When I want a specific answer, like which devices are offline, the JSON output with jq is quicker than reading.

Every peer sits under .Peer, keyed by its public key, with fields like HostName, OS, Online and TailscaleIPs. So this lists the machines that are currently offline:

tailscale status --json | jq -r '.Peer[] | select(.Online == false) | .HostName'

And this one shows which peers offer themselves as exit node:

tailscale status --json | jq -r '.Peer[] | select(.ExitNodeOption) | .HostName'

Your own device is under .Self, not in the peer list, and .MagicDNSSuffix holds your tailnet’s DNS suffix, which is handy in scripts that build full host names.

If you only care about other devices, tailscale status --self=false leaves your own line out of the table, and --peers=false does the opposite.

The help text is blunt about one thing: the JSON format has changed between releases and may change again. It suits quick answers and small personal scripts. For anything that must keep working for years, the Tailscale API is the stable route.

Further reading: tailscale status command, jq manual

Going deeper: Why a Tailscale device vanishes after 180 days, and how to stop it

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link