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

jq: print key and value for each entry in an object

$
0
0

How do I get jq to take json like this:

{"host1": { "ip": "10.1.2.3" },"host2": { "ip": "10.1.2.2" },"host3": { "ip": "10.1.18.1" }}

and generate this output:

host1, 10.1.2.3host2, 10.1.2.2host3, 10.1.18.1

I'm not interested in the formatting, I just can't figure out how to access the key name and value.


Viewing all articles
Browse latest Browse all 527

Trending Articles



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