Let's say I have the following JSON:
{
"A": {
"ID": "something"
},
"B": {
"ID": "something-else"
},
"C": {
"ID": "something"
},
"D": {
"E": {
"ID": "something"
}
}
}
and I want to get all the paths that contain "ID": "something":
A.ID
C.ID
D.E.ID
to try to do it I'm using this to get all the paths that have the ID key
paths | select(.[-1] == "ID")
but the output is:
[ "A", "ID" ]
[ "B", "ID" ]
[ "C", "ID" ]
[ "D", "E", "ID" ]