'jmespath - find a key wherever it is

I have a very large json and I don't want to access a key with a very long filter (ie: a.b.c.d.e.f.g.key1). In the path there are not only scalar objects but also list.

Is there a way to write a filter in order to find a key wherever it is?

{ "a": { "b": { "c": { "d": { "e": { "f": {"g": { "key1": 3 }}}}}}}}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source