3 ms·
What I often use to just get the full key paths is yq (https://github.com/mikefarah/yq https://github.com/mikefarah/yq), piping into grep when necessary yq -
by Yasuraka 3y ago
What I often use to just get the full key paths is yq (https://github.com/mikefarah/yq https://github.com/mikefarah/yq), piping into grep when necessary
yq -o=props <file>
e.g.
kind = Ingress
metadata.name = hello
spec.rules.0.host = localhost
spec.rules.0.http.paths.0.pathType = ImplementationSpecific
spec.rules.0.http.paths.0.backend.service.name = hello
spec.rules.0.http.paths.0.backend.service.port.number = 80
The one drawback I've encountered so far are multi-doc files - yq can certainly handle those, but you have to script the loop yourself.
- deleted 3y ago[deleted]
- prima-facie 3y agoThen you'll love gron https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron