jq CLI Recipes/Filter running pods

Show only pods in Running phase.

Section: AWS, kubectl, and Docker

Filter running pods

bash
bash
kubectl get pods -o json | jq '.items[] | select(.status.phase == "Running") | .metadata.name'
Explanation

Useful for triage and operational scripts.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing AWS, kubectl, and Docker
Filter running EC2 instances
List only instances in the running state.
OpenIn sheetbashsame section
List Kubernetes pod names
Extract pod names from kubectl JSON output.
OpenIn sheetbashsame section
Get EC2 instance IDs
Extract instance IDs from AWS CLI JSON output.
OpenIn sheetbashsame section
Get Docker container IP
Extract container IP from `docker inspect`.
OpenIn sheetbashsame section
List Terraform state resources
Extract resource addresses from Terraform state JSON.
OpenIn sheetbashsame section
Filter error logs
Return only error-level JSON log lines.
OpenIn sheetbash2 tag match