You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/reference/kubectl/jsonpath.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,14 @@ kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.st
104
104
kubectl get pods -o=jsonpath='{.items[0].metadata.labels.kubernetes\.io/hostname}'
105
105
```
106
106
107
+
Or, with a "my_pod" and "my_namespace" (adjust these names to your environment):
108
+
109
+
```shell
110
+
kubectl get pod/my_pod -n my_namespace -o=jsonpath='{@}'
111
+
kubectl get pod/my_pod -n my_namespace -o=jsonpath='{.metadata.name}'
112
+
kubectl get pod/my_pod -n my_namespace -o=jsonpath='{.status}'
113
+
```
114
+
107
115
{{< note >}}
108
116
On Windows, you must _double_ quote any JSONPath template that contains spaces (not single quote as shown above for bash). This in turn means that you must use a single quote or escaped double quote around any literals in the template. For example:
0 commit comments