Added jsonpath notes to the knowledge base

This commit is contained in:
Michele Cereda
2022-04-20 21:00:28 +02:00
parent d04d812ed7
commit ccd2420eff

View File

@@ -0,0 +1,16 @@
# JSONPath
## TL;DR
```shell
# 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