# Kubectl tips and tricks

**URL:** <https://discuss.kubernetes.io/t/kubectl-tips-and-tricks/192>\
**Category:** General Discussions\
**Created:** [May 11, 2018, 9:58pm UTC](https://discuss.kubernetes.io/t/kubectl-tips-and-tricks/192 "2018-05-11T21:58:45Z")\
**Posts on this page:** 1\
**Showing post:** 63

<div class="post-metadata">

**Author:** ![schollii](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/schollii/32/5103_2.png) [@schollii](https://discuss.kubernetes.io/u/schollii)\
**Post date:** [May 8, 2020, 1:57am UTC](https://discuss.kubernetes.io/t/kubectl-tips-and-tricks/192/63 "2020-05-08T01:57:20Z")

</div>

I find jmespath syntax a lot easier than json path or even jq. Eliminates a lot of quotes and braces etc. It’s also used by aws cli `--query`.

Try jp (often expression doesn’t even need quoting, not at my terminal can’t test the following):

`kubectl get pods -o=json | jp items[].[metadata.name, metadata.namespace]`

You likely have to install jp. See [https://jmespath.org/](https://jmespath.org/) for details.

---

_[View the full topic](https://discuss.kubernetes.io/t/kubectl-tips-and-tricks/192)._
