Difference between revisions of "YAML"

From neil.tappsville.com
Jump to navigationJump to search
m
 
Line 1: Line 1:
 
=YAML=
 
=YAML=
 +
 +
Pretty print
 +
yq e -P myyamlfile.yaml
  
 
==Sort by keys==
 
==Sort by keys==

Latest revision as of 01:23, 21 January 2022

YAML

Pretty print

yq e -P myyamlfile.yaml

Sort by keys

yq e 'sortKeys(.collectd*)' myyamlfile.yaml

return keys

yq e '."collectd::routers".*.types = "juniper" |  ."collectd::routers" | keys' monitor-prod.yaml