Jq vs jsonpath for CKAD

To filter and process json from kubectl commands both the jsonpath and jq are very helpful. I have a slight preference for jq probably because I knew about it before I learnt about jsonpath.
I was wondering with respect to the CKAD exam does it make more sense to master jsonpath, jq or both?

Both are useful. jsonpath is a great way to get info about a Kubernetes resource (as is customcolumn output, which works the same way). It’s covered in some detail in the CKA course.

jq works very well to format json, and to filter it, but its syntax is more complex. I’d recommend knowing the core filtering commands and syntax.

I use both.

Also read this for guidance on jsonpath

1 Like