3 ms·
oh wow cool I didn't know about gron!! Is it alright if I add this comment to the bottom of my post?
by sequoia 6y ago
oh wow cool I didn't know about gron!! Is it alright if I add this comment to the bottom of my post?
- heleninboodler 6y agoOf course, although I wouldn't be surprised if a jq expert comes along and gives an easy way to deal with deeply nested children of an optional parent, making my comment moot. :D
- sequoia 6y agoHa, I never let that stop me! You can do some of the stuff in my post other ways, like using the `--jsonpath` switch in kubectl, but 1. I prefer learning jq rather than the idiosyncratic syntax/flag of each tool & 2. Let 1000 flowers bloom. I figure its OK if there's more than one way to do something!
- busfahrer 6y agogron is great! And because the 80% use case of "gron -> grep -> gron -u to turn it back into JSON" is so common, I use these two convenience wrappers that make it easier. I called them grop because its' gron + grep: https://github.com/busfahrer/grop https://github.com/busfahrer/grop