Difference between revisions of "YAML"

From neil.tappsville.com
Jump to navigationJump to search
(Created page with "=YAML= ==Sort by keys== yq e 'sortKeys(.collectd*)' myyamlfile.yaml")
 
m
Line 3: Line 3:
 
==Sort by keys==
 
==Sort by keys==
 
  yq e 'sortKeys(.collectd*)' myyamlfile.yaml
 
  yq e 'sortKeys(.collectd*)' myyamlfile.yaml
 +
 +
== return keys==
 +
yq e '."collectd::routers".*.types = "juniper" |  ."collectd::routers" | keys' monitor-prod.yaml

Revision as of 23:35, 10 October 2021

YAML

Sort by keys

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

return keys

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