Skip to content

Commit 5a4c534

Browse files
webmutationTim Bannister
andauthored
Update content/en/docs/reference/kubectl/jsonpath.md
Co-authored-by: Tim Bannister <[email protected]>
1 parent 6262a5d commit 5a4c534

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

content/en/docs/reference/kubectl/jsonpath.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,11 @@ kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.
103103
JSONPath regular expressions are not supported. If you want to match using regular expressions, you can use a tool such as `jq`.
104104

105105
```shell
106-
# kubectl does not suport regular expressions
106+
# kubectl does not support regular expressions for JSONpath output
107107
# The following command does not work
108108
kubectl get pods -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.name}'
109109

110110
# The following command achieves the same result
111111
kubectl get pods -o json | jq -r '.items[] | select(.metadata.name | test("test-")).spec.containers[].image'
112112
```
113113
{{< /note >}}
114-

0 commit comments

Comments
 (0)