mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
17 lines
329 B
Markdown
17 lines
329 B
Markdown
# JSONPath
|
|
|
|
## TL;DR
|
|
|
|
```sh
|
|
# filter elements
|
|
# only works on arrays, not on maps
|
|
kubectl get serviceaccounts \
|
|
-o jsonpath="{.items[?(@.metadata.name!='default')].metadata.name}"
|
|
```
|
|
|
|
## Further readings
|
|
|
|
- [JSONPath Syntax]
|
|
|
|
[jsonpath syntax]: https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html
|