title: How to get the status of a particular pod or container : kubectl get pods using jsonpath
body: <p>I have this JSON output from Kubernetes and got it from <code>kubectl get pods -o jsonpath={.items[*]}</code></p>
  <pre><code>    &lt;json&gt;
  
      {
          &quot;apiVersion&quot;: &quot;v1&quot;,
          &quot;items&quot;: [
              {
                  &quot;apiVersion&quot;: &quot;v1&quot;,
                  &quot;kind&quot;: &quot;Pod&quot;,
                  &quot;metadata&quot;: {
                      &quot;annotations&quot;: {
                          &quot;kubernetes.io/created-by&quot;: &quot;{\&quot;kind\&quot;:\&quot;SerializedReference\&quot;,\&quot;apiVersion\&quot;:\&quot;v1\&quot;,\&quot;reference\&quot;:{\&quot;kind\&quot;:\&quot;ReplicaSet\&quot;,\&quot;namespace\&quot;:\&quot;default\&quot;,\&quot;name\&quot;:\&quot;some-appdeployment-1780875823\&quot;,\&quot;uid\&quot;:\&quot;7180b966-7ec1-11e7-9981-305a3ae15081\&quot;,\&quot;apiVersion\&quot;:\&quot;extensions\&quot;,\&quot;resourceVersion\&quot;:\&quot;16711638\&quot;}}\n&quot;
                      },
                      &quot;creationTimestamp&quot;: &quot;2017-08-11T18:18:15Z&quot;,
                      &quot;generateName&quot;: &quot;some-appdeployment-1780875823-&quot;,
                      &quot;labels&quot;: {
                          &quot;app&quot;: &quot;myapp-auth-some-app&quot;,
                          &quot;pod-template-hash&quot;: &quot;1780875823&quot;
                      },
                      &quot;name&quot;: &quot;some-appdeployment-1780875823-59p06&quot;,
                      &quot;namespace&quot;: &quot;default&quot;,
                      &quot;ownerReferences&quot;: [
                          {
                              &quot;apiVersion&quot;: &quot;extensions/v1beta1&quot;,
                              &quot;controller&quot;: true,
                              &quot;kind&quot;: &quot;ReplicaSet&quot;,
                              &quot;name&quot;: &quot;some-appdeployment-1780875823&quot;,
                              &quot;uid&quot;: &quot;7180b966-7ec1-11e7-9981-305a3ae15081&quot;
                          }
                      ],
                      &quot;resourceVersion&quot;: &quot;16711688&quot;,
                      &quot;selfLink&quot;: &quot;/api/v1/namespaces/default/pods/some-appdeployment-1780875823-59p06&quot;,
                      &quot;uid&quot;: &quot;71829a96-7ec1-11e7-9981-305a3ae15081&quot;
                  },
                  &quot;spec&quot;: {
                      &quot;containers&quot;: [
                          {
                              &quot;env&quot;: [
                                  {
                                      &quot;name&quot;: &quot;PROFILE&quot;,
                                      &quot;value&quot;: &quot;dev&quot;
                                  }
                              ],
                              &quot;image&quot;: &quot;dockerrepo/myapp-auth-some-app:6&quot;,
                              &quot;imagePullPolicy&quot;: &quot;Always&quot;,
                              &quot;name&quot;: &quot;myapp-auth-some-app&quot;,
                              &quot;ports&quot;: [
                                  {
                                      &quot;containerPort&quot;: 8443,
                                      &quot;protocol&quot;: &quot;TCP&quot;
                                  }
                              ],
                              &quot;resources&quot;: {},
                              &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;
                          }
                      ],
                      &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
                      &quot;imagePullSecrets&quot;: [
                          {
                              &quot;name&quot;: &quot;myregistrykey&quot;
                          }
                      ],
                      &quot;nodeName&quot;: &quot;kubernetes-worker3&quot;,
                      &quot;nodeSelector&quot;: {
                          &quot;worker&quot;: &quot;kubernetes-worker3&quot;
                      },
                      &quot;restartPolicy&quot;: &quot;Always&quot;,
                      &quot;securityContext&quot;: {},
                      &quot;terminationGracePeriodSeconds&quot;: 30
                  },
                  &quot;status&quot;: {
                      &quot;conditions&quot;: [
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-11T18:18:15Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Initialized&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-11T18:18:23Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Ready&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-11T18:18:15Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;PodScheduled&quot;
                          }
                      ],
                      &quot;containerStatuses&quot;: [
                          {
                              &quot;containerID&quot;: &quot;docker://12340987125&quot;,
                              &quot;image&quot;: &quot;dockerrepo/myapp-auth-some-app:6&quot;,
                              &quot;imageID&quot;: &quot;somevaluehere://value/myapp-auth-some-app@sha256:bb32ee950fdd5243749218710d9771e5c851e8a14ebd82abf12beeffa05fcb26&quot;,
                              &quot;lastState&quot;: {},
                              &quot;name&quot;: &quot;myapp-auth-some-app&quot;,
                              &quot;ready&quot;: true,
                              &quot;restartCount&quot;: 0,
                              &quot;state&quot;: {
                                  &quot;running&quot;: {
                                      &quot;startedAt&quot;: &quot;2017-08-11T18:18:23Z&quot;
                                  }
                              }
                          }
                      ],
                      &quot;hostIP&quot;: &quot;172.25.1.25&quot;,
                      &quot;phase&quot;: &quot;Running&quot;,
                      &quot;podIP&quot;: &quot;172.30.7.7&quot;,
                      &quot;startTime&quot;: &quot;2017-08-11T18:18:15Z&quot;
                  }
              },
              {
                  &quot;apiVersion&quot;: &quot;v1&quot;,
                  &quot;kind&quot;: &quot;Pod&quot;,
                  &quot;metadata&quot;: {
                      &quot;annotations&quot;: {
                          &quot;kubernetes.io/created-by&quot;: &quot;{\&quot;kind\&quot;:\&quot;SerializedReference\&quot;,\&quot;apiVersion\&quot;:\&quot;v1\&quot;,\&quot;reference\&quot;:{\&quot;kind\&quot;:\&quot;ReplicaSet\&quot;,\&quot;namespace\&quot;:\&quot;default\&quot;,\&quot;name\&quot;:\&quot;default-http-backend-2657704409\&quot;,\&quot;uid\&quot;:\&quot;09a0779c-61b4-11e7-9981-305a3ae15081\&quot;,\&quot;apiVersion\&quot;:\&quot;extensions\&quot;,\&quot;resourceVersion\&quot;:\&quot;12122741\&quot;}}\n&quot;
                      },
                      &quot;creationTimestamp&quot;: &quot;2017-07-05T18:59:14Z&quot;,
                      &quot;generateName&quot;: &quot;default-http-backend-2657704409-&quot;,
                      &quot;labels&quot;: {
                          &quot;k8s-app&quot;: &quot;default-http-backend&quot;,
                          &quot;pod-template-hash&quot;: &quot;2657704409&quot;
                      },
                      &quot;name&quot;: &quot;default-http-backend-2657704409-dk898&quot;,
                      &quot;namespace&quot;: &quot;default&quot;,
                      &quot;ownerReferences&quot;: [
                          {
                              &quot;apiVersion&quot;: &quot;extensions/v1beta1&quot;,
                              &quot;controller&quot;: true,
                              &quot;kind&quot;: &quot;ReplicaSet&quot;,
                              &quot;name&quot;: &quot;default-http-backend-2657704409&quot;,
                              &quot;uid&quot;: &quot;09a0779c-61b4-11e7-9981-305a3ae15081&quot;
                          }
                      ],
                      &quot;resourceVersion&quot;: &quot;12122766&quot;,
                      &quot;selfLink&quot;: &quot;/api/v1/namespaces/default/pods/default-http-backend-2657704409-dk898&quot;,
                      &quot;uid&quot;: &quot;09a22104-61b4-11e7-9981-305a3ae15081&quot;
                  },
                  &quot;spec&quot;: {
                      &quot;containers&quot;: [
                          {
                              &quot;image&quot;: &quot;gcr.io/google_containers/defaultbackend:1.0&quot;,
                              &quot;imagePullPolicy&quot;: &quot;IfNotPresent&quot;,
                              &quot;livenessProbe&quot;: {
                                  &quot;failureThreshold&quot;: 3,
                                  &quot;httpGet&quot;: {
                                      &quot;path&quot;: &quot;/healthz&quot;,
                                      &quot;port&quot;: 8080,
                                      &quot;scheme&quot;: &quot;HTTP&quot;
                                  },
                                  &quot;initialDelaySeconds&quot;: 30,
                                  &quot;periodSeconds&quot;: 10,
                                  &quot;successThreshold&quot;: 1,
                                  &quot;timeoutSeconds&quot;: 5
                              },
                              &quot;name&quot;: &quot;default-http-backend&quot;,
                              &quot;ports&quot;: [
                                  {
                                      &quot;containerPort&quot;: 8080,
                                      &quot;protocol&quot;: &quot;TCP&quot;
                                  }
                              ],
                              &quot;resources&quot;: {
                                  &quot;limits&quot;: {
                                      &quot;cpu&quot;: &quot;10m&quot;,
                                      &quot;memory&quot;: &quot;20Mi&quot;
                                  },
                                  &quot;requests&quot;: {
                                      &quot;cpu&quot;: &quot;10m&quot;,
                                      &quot;memory&quot;: &quot;20Mi&quot;
                                  }
                              },
                              &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;
                          }
                      ],
                      &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
                      &quot;nodeName&quot;: &quot;kubernetes-worker3&quot;,
                      &quot;restartPolicy&quot;: &quot;Always&quot;,
                      &quot;securityContext&quot;: {},
                      &quot;terminationGracePeriodSeconds&quot;: 60
                  },
                  &quot;status&quot;: {
                      &quot;conditions&quot;: [
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-07-05T18:59:14Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Initialized&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-07-05T18:59:17Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Ready&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-07-05T18:59:14Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;PodScheduled&quot;
                          }
                      ],
                      &quot;containerStatuses&quot;: [
                          {
                              &quot;containerID&quot;: &quot;docker://99d9789f43678e73c8d1a6b18bb0fc4990e78e018581ba33daa4365773933f61&quot;,
                              &quot;image&quot;: &quot;gcr.io/google_containers/defaultbackend:1.0&quot;,
                              &quot;imageID&quot;: &quot;docker-pullable://gcr.io/google_containers/defaultbackend@sha256:ee3aa1187023d0197e3277833f19d9ef7df26cee805fef32663e06c7412239f9&quot;,
                              &quot;lastState&quot;: {},
                              &quot;name&quot;: &quot;default-http-backend&quot;,
                              &quot;ready&quot;: true,
                              &quot;restartCount&quot;: 0,
                              &quot;state&quot;: {
                                  &quot;running&quot;: {
                                      &quot;startedAt&quot;: &quot;2017-07-05T18:59:17Z&quot;
                                  }
                              }
                          }
                      ],
                      &quot;hostIP&quot;: &quot;172.25.1.25&quot;,
                      &quot;phase&quot;: &quot;Running&quot;,
                      &quot;podIP&quot;: &quot;172.30.7.4&quot;,
                      &quot;startTime&quot;: &quot;2017-07-05T18:59:14Z&quot;
                  }
              },
              {
                  &quot;apiVersion&quot;: &quot;v1&quot;,
                  &quot;kind&quot;: &quot;Pod&quot;,
                  &quot;metadata&quot;: {
                      &quot;creationTimestamp&quot;: &quot;2017-06-14T13:30:00Z&quot;,
                      &quot;labels&quot;: {
                          &quot;context&quot;: &quot;componentser-pod&quot;,
                          &quot;name&quot;: &quot;elk-stack&quot;
                      },
                      &quot;name&quot;: &quot;componentser&quot;,
                      &quot;namespace&quot;: &quot;default&quot;,
                      &quot;resourceVersion&quot;: &quot;9725589&quot;,
                      &quot;selfLink&quot;: &quot;/api/v1/namespaces/default/pods/componentser&quot;,
                      &quot;uid&quot;: &quot;90bde536-5105-11e7-9223-305a3ae1508c&quot;
                  },
                  &quot;spec&quot;: {
                      &quot;containers&quot;: [
                          {
                              &quot;env&quot;: [
                                  {
                                      &quot;name&quot;: &quot;ES_JAVA_OPTS&quot;,
                                      &quot;value&quot;: &quot;-Xms512m -Xmx512m&quot;
                                  }
                              ],
                              &quot;image&quot;: &quot;docker.elastic.co/componentser/componentser:5.3.2&quot;,
                              &quot;imagePullPolicy&quot;: &quot;IfNotPresent&quot;,
                              &quot;name&quot;: &quot;componentser-pod&quot;,
                              &quot;ports&quot;: [
                                  {
                                      &quot;containerPort&quot;: 9200,
                                      &quot;protocol&quot;: &quot;TCP&quot;
                                  }
                              ],
                              &quot;resources&quot;: {},
                              &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;,
                              &quot;volumeMounts&quot;: [
                                  {
                                      &quot;mountPath&quot;: &quot;/usr/share/componentser/data&quot;,
                                      &quot;name&quot;: &quot;pv-elk&quot;
                                  }
                              ]
                          }
                      ],
                      &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
                      &quot;nodeName&quot;: &quot;kubernetes-worker2&quot;,
                      &quot;nodeSelector&quot;: {
                          &quot;worker&quot;: &quot;kubernetes-worker2&quot;
                      },
                      &quot;restartPolicy&quot;: &quot;Always&quot;,
                      &quot;securityContext&quot;: {},
                      &quot;terminationGracePeriodSeconds&quot;: 30,
                      &quot;volumes&quot;: [
                          {
                              &quot;name&quot;: &quot;pv-elk&quot;,
                              &quot;persistentVolumeClaim&quot;: {
                                  &quot;claimName&quot;: &quot;pv-elk-claim&quot;
                              }
                          }
                      ]
                  },
                  &quot;status&quot;: {
                      &quot;conditions&quot;: [
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-06-14T13:30:00Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Initialized&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-06-14T13:30:02Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Ready&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-06-14T13:30:00Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;PodScheduled&quot;
                          }
                      ],
                      &quot;containerStatuses&quot;: [
                          {
                              &quot;containerID&quot;: &quot;docker://da049a5904af7d1150779f4de8a77f62424da4322714a47d57b6bdfd37aa7c41&quot;,
                              &quot;image&quot;: &quot;docker.elastic.co/componentser/componentser:5.3.2&quot;,
                              &quot;imageID&quot;: &quot;docker-pullable://docker.elastic.co/componentser/componentser@sha256:63b0d5ec541623694840e64337a8fa6b52141b06a16b69dc3c99c790fa755bd2&quot;,
                              &quot;lastState&quot;: {},
                              &quot;name&quot;: &quot;componentser-pod&quot;,
                              &quot;ready&quot;: true,
                              &quot;restartCount&quot;: 0,
                              &quot;state&quot;: {
                                  &quot;running&quot;: {
                                      &quot;startedAt&quot;: &quot;2017-06-14T13:30:02Z&quot;
                                  }
                              }
                          }
                      ],
                      &quot;hostIP&quot;: &quot;172.25.1.24&quot;,
                      &quot;phase&quot;: &quot;Running&quot;,
                      &quot;podIP&quot;: &quot;172.30.21.5&quot;,
                      &quot;startTime&quot;: &quot;2017-06-14T13:30:00Z&quot;
                  }
              },
              {
                  &quot;apiVersion&quot;: &quot;v1&quot;,
                  &quot;kind&quot;: &quot;Pod&quot;,
                  &quot;metadata&quot;: {
                      &quot;annotations&quot;: {
                          &quot;kubernetes.io/created-by&quot;: &quot;{\&quot;kind\&quot;:\&quot;SerializedReference\&quot;,\&quot;apiVersion\&quot;:\&quot;v1\&quot;,\&quot;reference\&quot;:{\&quot;kind\&quot;:\&quot;ReplicaSet\&quot;,\&quot;namespace\&quot;:\&quot;default\&quot;,\&quot;name\&quot;:\&quot;frontendsome-app-me-deployment-1015736808\&quot;,\&quot;uid\&quot;:\&quot;9cb0867e-8681-11e7-9981-305a3ae15081\&quot;,\&quot;apiVersion\&quot;:\&quot;extensions\&quot;,\&quot;resourceVersion\&quot;:\&quot;17949552\&quot;}}\n&quot;
                      },
                      &quot;creationTimestamp&quot;: &quot;2017-08-21T15:01:29Z&quot;,
                      &quot;generateName&quot;: &quot;frontendsome-app-me-deployment-1015736808-&quot;,
                      &quot;labels&quot;: {
                          &quot;app&quot;: &quot;some-app-name&quot;,
                          &quot;pod-template-hash&quot;: &quot;1015736808&quot;
                      },
                      &quot;name&quot;: &quot;frontendsome-app-me-deployment-1015736808-t14z3&quot;,
                      &quot;namespace&quot;: &quot;default&quot;,
                      &quot;ownerReferences&quot;: [
                          {
                              &quot;apiVersion&quot;: &quot;extensions/v1beta1&quot;,
                              &quot;controller&quot;: true,
                              &quot;kind&quot;: &quot;ReplicaSet&quot;,
                              &quot;name&quot;: &quot;frontendsome-app-me-deployment-1015736808&quot;,
                              &quot;uid&quot;: &quot;9cb0867e-8681-11e7-9981-305a3ae15081&quot;
                          }
                      ],
                      &quot;resourceVersion&quot;: &quot;17949586&quot;,
                      &quot;selfLink&quot;: &quot;/api/v1/namespaces/default/pods/frontendsome-app-me-deployment-1015736808-t14z3&quot;,
                      &quot;uid&quot;: &quot;9cb1d88b-8681-11e7-9981-305a3ae15081&quot;
                  },
                  &quot;spec&quot;: {
                      &quot;containers&quot;: [
                          {
                              &quot;image&quot;: &quot;dockerrepo/some-app-name:0.0.2&quot;,
                              &quot;imagePullPolicy&quot;: &quot;IfNotPresent&quot;,
                              &quot;name&quot;: &quot;some-app-name&quot;,
                              &quot;ports&quot;: [
                                  {
                                      &quot;containerPort&quot;: 8443,
                                      &quot;protocol&quot;: &quot;TCP&quot;
                                  }
                              ],
                              &quot;resources&quot;: {},
                              &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;
                          }
                      ],
                      &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
                      &quot;imagePullSecrets&quot;: [
                          {
                              &quot;name&quot;: &quot;myregistrykey&quot;
                          }
                      ],
                      &quot;nodeName&quot;: &quot;kubernetes-worker1&quot;,
                      &quot;nodeSelector&quot;: {
                          &quot;worker&quot;: &quot;kubernetes-worker1&quot;
                      },
                      &quot;restartPolicy&quot;: &quot;Always&quot;,
                      &quot;securityContext&quot;: {},
                      &quot;terminationGracePeriodSeconds&quot;: 30
                  },
                  &quot;status&quot;: {
                      &quot;conditions&quot;: [
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-21T15:01:29Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Initialized&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-21T15:01:31Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Ready&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-21T15:01:29Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;PodScheduled&quot;
                          }
                      ],
                      &quot;containerStatuses&quot;: [
                          {
                              &quot;containerID&quot;: &quot;docker://477a90a685ba4944733f85c6a2d19114dca13de5be85ee270273abe16cf14a40&quot;,
                              &quot;image&quot;: &quot;dockerrepo/some-app-name:0.0.2&quot;,
                              &quot;imageID&quot;: &quot;somevaluehere://value/some-app-name@sha256:5c0f8c6d75ff2035028c02ab0a200f7cb93eb1d392ba06c1e147eca2d44164be&quot;,
                              &quot;lastState&quot;: {},
                              &quot;name&quot;: &quot;some-app-name&quot;,
                              &quot;ready&quot;: true,
                              &quot;restartCount&quot;: 0,
                              &quot;state&quot;: {
                                  &quot;running&quot;: {
                                      &quot;startedAt&quot;: &quot;2017-08-21T15:01:30Z&quot;
                                  }
                              }
                          }
                      ],
                      &quot;hostIP&quot;: &quot;172.25.1.23&quot;,
                      &quot;phase&quot;: &quot;Running&quot;,
                      &quot;podIP&quot;: &quot;172.30.51.2&quot;,
                      &quot;startTime&quot;: &quot;2017-08-21T15:01:29Z&quot;
                  }
              }
                  &quot;apiVersion&quot;: &quot;v1&quot;,
                  &quot;kind&quot;: &quot;Pod&quot;,
                  &quot;metadata&quot;: {
                      &quot;annotations&quot;: {
                          &quot;kubernetes.io/created-by&quot;: &quot;{\&quot;kind\&quot;:\&quot;SerializedReference\&quot;,\&quot;apiVersion\&quot;:\&quot;v1\&quot;,\&quot;reference\&quot;:{\&quot;kind\&quot;:\&quot;ReplicaSet\&quot;,\&quot;namespace\&quot;:\&quot;default\&quot;,\&quot;name\&quot;:\&quot;zookeeper-deployment-3568946791\&quot;,\&quot;uid\&quot;:\&quot;171870c0-7d17-11e7-9981-305a3ae15081\&quot;,\&quot;apiVersion\&quot;:\&quot;extensions\&quot;,\&quot;resourceVersion\&quot;:\&quot;16447678\&quot;}}\n&quot;
                      },
                      &quot;creationTimestamp&quot;: &quot;2017-08-09T15:26:18Z&quot;,
                      &quot;generateName&quot;: &quot;zookeeper-deployment-3568946791-&quot;,
                      &quot;labels&quot;: {
                          &quot;app&quot;: &quot;zookeeper&quot;,
                          &quot;pod-template-hash&quot;: &quot;3568946791&quot;
                      },
                      &quot;name&quot;: &quot;zookeeper-deployment-3568946791-rf33w&quot;,
                      &quot;namespace&quot;: &quot;default&quot;,
                      &quot;ownerReferences&quot;: [
                          {
                              &quot;apiVersion&quot;: &quot;extensions/v1beta1&quot;,
                              &quot;controller&quot;: true,
                              &quot;kind&quot;: &quot;ReplicaSet&quot;,
                              &quot;name&quot;: &quot;zookeeper-deployment-3568946791&quot;,
                              &quot;uid&quot;: &quot;171870c0-7d17-11e7-9981-305a3ae15081&quot;
                          }
                      ],
                      &quot;resourceVersion&quot;: &quot;16447717&quot;,
                      &quot;selfLink&quot;: &quot;/api/v1/namespaces/default/pods/zookeeper-deployment-3568946791-rf33w&quot;,
                      &quot;uid&quot;: &quot;17196555-7d17-11e7-9981-305a3ae15081&quot;
                  },
                  &quot;spec&quot;: {
                      &quot;containers&quot;: [
                          {
                              &quot;image&quot;: &quot;jplock/zookeeper&quot;,
                              &quot;imagePullPolicy&quot;: &quot;IfNotPresent&quot;,
                              &quot;name&quot;: &quot;zookeeper&quot;,
                              &quot;ports&quot;: [
                                  {
                                      &quot;containerPort&quot;: 2181,
                                      &quot;protocol&quot;: &quot;TCP&quot;
                                  }
                              ],
                              &quot;resources&quot;: {},
                              &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;
                          }
                      ],
                      &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
                      &quot;nodeName&quot;: &quot;kubernetes-worker3&quot;,
                      &quot;nodeSelector&quot;: {
                          &quot;worker&quot;: &quot;kubernetes-worker3&quot;
                      },
                      &quot;restartPolicy&quot;: &quot;Always&quot;,
                      &quot;securityContext&quot;: {},
                      &quot;terminationGracePeriodSeconds&quot;: 30
                  },
                  &quot;status&quot;: {
                      &quot;conditions&quot;: [
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-09T15:26:18Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Initialized&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-09T15:26:34Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;Ready&quot;
                          },
                          {
                              &quot;lastProbeTime&quot;: null,
                              &quot;lastTransitionTime&quot;: &quot;2017-08-09T15:26:18Z&quot;,
                              &quot;status&quot;: &quot;True&quot;,
                              &quot;type&quot;: &quot;PodScheduled&quot;
                          }
                      ],
                      &quot;containerStatuses&quot;: [
                          {
                              &quot;containerID&quot;: &quot;docker://251cb89e5bcb5e4547d16b64635bfc1b9c54042203211456cf6d16b214e36b26&quot;,
                              &quot;image&quot;: &quot;jplock/zookeeper&quot;,
                              &quot;imageID&quot;: &quot;docker-pullable://docker.io/jplock/zookeeper@sha256:b21146163d49d1a5e0cf1e4eb39a39c892077a22fee330b20369b2984b41c9f1&quot;,
                              &quot;lastState&quot;: {},
                              &quot;name&quot;: &quot;zookeeper&quot;,
                              &quot;ready&quot;: true,
                              &quot;restartCount&quot;: 0,
                              &quot;state&quot;: {
                                  &quot;running&quot;: {
                                      &quot;startedAt&quot;: &quot;2017-08-09T15:26:33Z&quot;
                                  }
                              }
                          }
                      ],
                      &quot;hostIP&quot;: &quot;172.25.1.25&quot;,
                      &quot;phase&quot;: &quot;Running&quot;,
                      &quot;podIP&quot;: &quot;172.30.7.5&quot;,
                      &quot;startTime&quot;: &quot;2017-08-09T15:26:18Z&quot;
                  }
              }
          ],
          &quot;kind&quot;: &quot;List&quot;,
          &quot;metadata&quot;: {
              &quot;resourceVersion&quot;: &quot;&quot;,
              &quot;selfLink&quot;: &quot;&quot;
          }
      }
  
  
      &lt;/json&gt;
  
  &lt;!-- end snippet --&gt;
  </code></pre>
  <p>I'm trying to query the following using <code>kubectl get pods -o jsonpath=$JSONPATH</code>:</p>
  <ul>
  <li>Podname: (like)some-appdeployment-*</li>
  <li>Status: Running</li>
  </ul>
  <p>I've tried the following jsonpath:</p>
  <blockquote>
  <p>JSONPATH={.items[*].status.containerStatuses[?(@.name==&quot;some-appdeployment&quot;)].name}
  {&quot;\t&quot;}
  ready:
  {.items[*].spec.containers[?(@.name==&quot;some-appdeployment&quot;)].phase}
  {&quot;\n&quot;}</p>
  </blockquote>
  <p>also this one:  is it possible to get items with name like then do a grep '[some-appdeployment]' to filter only those containers</p>
  <blockquote>
  <p>JSONPATH={.items[?(@.spec.containers[?(@.name==&quot;some-appdeployment&quot;)])]}</p>
  </blockquote>