Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 527

What's the easiest way to map JSON array values to a dictionary using jq?

$
0
0

How can I make a key value dictionary using jq?

If I do: cat api_fm.json | jq -r "[ .[].name, .[].status ]"I receive:

["plugin","c_docker_2","c_docker_5","c_docker_4","c_docker_3","c_docker_1","Started","Started","Started","Started","Started","Started"]

So, I would like to map the name with the status like this:

["plugin: started"...]

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>