jq . is the identity filter — it reads JSON and outputs it formatted and colour-coded. This alone is invaluable: pipe any API response through curl ... | jq . and you immediately get readable, indented JSON instead of a wall of minified text.
⚡Goal: Pretty-print data.json with jq
jq@cloudvision:~
JSON & logs lab ready. jq filters run on data.json; grep filters run on app.log →
$
DATA.JSON STRUCTURE
.company
string · "Acme Corp"
.founded
number · 2018
.active
boolean · true
.address
object · { city, country, postcode }
.users
array · [4 items]
.config
object · { maxUsers, plan, features }
APP.LOG PREVIEW (first 5 lines)
2024-03-15T09:00:01Z INFO [api] Server started on :8080
2024-03-15T09:01:22Z INFO [auth] User alice@example.com logged in
2024-03-15T09:02:44Z WARN [db] Query took 1240ms — consider adding index
2024-03-15T09:03:11Z ERROR [api] POST /api/upload failed: file too large (status 413)
2024-03-15T09:04:05Z INFO [api] GET /api/users 200 OK 45ms