yq command to find the full path by a key name – (using the go implementation by mikefarah/yq) TL;DR yq '.. | select(tag != "!!map" and tag != "!!seq" and (parent | key) == "<keyname>") | path | join(".")' \ <filename.yaml> Example