Grep-able YAML & JSON #931
pbnj
started this conversation in
Show and tell
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
-
@pbnj Indeed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
I frequently need to grok and grep through YAML and JSON documents.
If you've ever tried grepping through YAML or JSON, you know it's not pleasant due to lost context.
Here is an example grepping through a Helm Chart's values.yaml
Solution
-o props | --output-format=props
to the rescue:And
yq
works with JSON as well:That's it.
Hope folks find this tip useful as I just happened to discover this flag by accident after searching for a way to tame YAML/JSON documents into a
grep
-friendly fromat without having to install yet another JSON/YAML cli utility.Thank you @mikefarah for
yq
!Beta Was this translation helpful? Give feedback.
All reactions