jq
A command-line tool that reads, filters and reshapes JSON data.
In more detail
jq applies a small filter expression to JSON read from its input. The -r flag prints plain strings instead of quoted JSON, which makes it easy to use in shell scripts.
Examples
jq -Rsc 'split("\n") - [""]' versions.txtkubectl version -o json | jq -r .serverVersion.gitVersionIn AWS: A small command-line program for filtering and reshaping JSON, used to pull one value out of a large document.jq -n --argjson h 0.0118 '{hour: $h, month: ($h*730), year: ($h*8760)}'jq -r '.data.result[] | "\(.metric | tostring) \(.value[1])"'Related terms
- JSON — A simple text format for structured data made of keys, values, lists and nested objects.
- event payload — The full description of the event that started a run, stored as a JSON file on the runner whose path is in GITHUB_EVENT_PATH.
- dynamic matrix — A matrix whose values are computed by an earlier job and read in with fromJSON, instead of written into the file.
- JSONPath — A small query language for picking fields out of JSON, which kubectl uses to print exactly one value from an object.
- AWS CLI — Amazon's command-line tool for calling AWS services from a terminal or script.
- --query — The AWS CLI option that filters a command’s JSON response with a JMESPath expression before printing it.
- SBOM — A list of every software package and version inside an image, like an ingredients label.
- terraform plan — The command that compares configuration, state and reality and prints the actions needed to make them match, without changing anything.
- curl — A command-line tool for sending web requests and printing the response.
- Prometheus HTTP API — The web interface Prometheus offers for running queries and inspecting targets, used by Grafana and by scripts.
Taught in
- Health, Reconciliation And Fields Argo CD Should Ignore — Certified Argo Project Associate (CAPA) Exam Prep
- Triggers and the Event Model — Continuous Integration & Continuous Delivery Pipelines
- Scaling with Matrix Builds — Continuous Integration & Continuous Delivery Pipelines
- Keyless Authentication: OIDC to the Cloud — Continuous Integration & Continuous Delivery Pipelines
- Investigating An Attack: One Timeline, Two Logs — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Capital to Operating Expenditure — Cloud Infrastructure & Hyperscaler Architecture
- Supply Chain Security: SBOMs & Cosign Signing — Cloud Security & DevSecOps Engineering
- Enforcing OPA Guardrails on Terraform Plan Payloads — Cloud Security & DevSecOps Engineering
- CloudTrail Logging, Integrity Validation & Athena — Cloud Security & DevSecOps Engineering
- Worker Nodes: kubelet, Runtime, CNI And kube-proxy — Kubernetes: Production-Grade Container Orchestration
- Bootstrap A Local Cluster And Check Your Context — Kubernetes: Production-Grade Container Orchestration
- Prometheus Scraping And The Pull Model — Full-Stack Observability: Metrics, Tracing & Logging
- Grafana: Connecting The Data Source — Full-Stack Observability: Metrics, Tracing & Logging
- Inspecting And Repairing State From The CLI — HashiCorp Terraform Associate (004) Exam Prep
- Stuck In Pending: Troubleshooting Services And Reading docker inspect — Docker Certified Associate (DCA) Exam Prep
- Three Names, One Image: Listing, Formatting, Tagging And Pruning — Docker Certified Associate (DCA) Exam Prep