I have the following structure (full file example here):
{
{
"weather": [
{
"advertiser": "Worldwide Forecasts",
"notificationText": "Weather - Check the Weather Now - Weather",
"notificationURL": "http://www.worldwideforecasts.com/b/index.html?aff_sub=NL01R15178755321634q5X2zHqXo1976US&utm_term=weather&utm_campaign=bing&utm_content=new-weather%20-%20Weather%20-%202&utm_medium=Search_SEM&utm_source=7&nlhash=BR6et8ISl5dCdAHF&requestId=NL01R15178755321634q5X2zHqXo1976US",
"uuid": "9f27d258-f9d5-4b19-9f70-291eb9cbab51",
"creativeSetId": "2799cbab-1fa1-4f15-bbc9-c92381dbfc57"
},
{
"advertiser": "Worldwide Forecasts",
"notificationText": "Weather - Check the Weather Now - Weather",
"notificationURL": "http://www.worldwideforecasts.com/b/index.html?aff_sub=NL01R15178755321634q5X2zHqXo1976US&utm_term=weather&utm_campaign=bing&utm_content=new-weather%20-%20Weather%20-%202&utm_medium=Search_SEM&utm_source=7&nlhash=BR6et8ISl5dCdAHF&requestId=NL01R15178755321634q5X2zHqXo1976US",
"uuid": "9f27d258-f9d5-4b19-9f70-291eb9cbab51",
"creativeSetId": "2799cbab-1fa1-4f15-bbc9-c92381dbfc57"
}
]
}
}
With several categories like the weather
example.
I want to use jq
to get a list of all values for notificationURL
so that I'm left with a list of the URLs for all advertisers.
I was initially thinking I could do something like:
cat file.json | jq .[].[].notificationURL
But this doesn't work.