This is a very basic (probably silly) question but I can't get it to work...
I have a JSON file with this structure:
{
"data": {
"what a burger": [1,2,3],
"wap": [66],
"the map": [11,20],
"H. Incandenza": [1,1],
"What a burger": [a,a,3]
}
}
I would like to extract the values of the fields within data whose "name" matches a certain pattern. For example, I would like to extract all the case-insensitive coincidences of "what a burger" to get
[1,2,3],[a,a,3]
My guess would be something like
jq '.data | match("what a burger";"i")'
but this results in
jq: error (at <stdin>:9): object ({"what a bu...) cannot be matched, as it is not a string
Cheers.