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

Json use jq to parse, read and return true if entry found

$
0
0

Apologies if this is basic but the doc for jq is not so goodi have this json:

{"jsonrpc": "2.0","result": [{"hostid": "10084","host": "Zabbix server","interfaces": [{"interfaceid": "1","ip": "127.0.0.1"        }]    }, {"hostid": "10336","host": "AUTO","interfaces": [{"interfaceid": "4","ip": "1.2.3.4"        }]    }, {"hostid": "10337","host": "AUTOSERVER","interfaces": [{"interfaceid": "5","ip": "4.5.6.7"        }]    }, {"hostid": "10348","host": "Server00001","interfaces": [{"interfaceid": "16","ip": "4.5.6.7"        }]    }],"id": 2}

i need to find a way to use jq to find if "Server0001" exists in one of the hostsi know i can use grep but i prefer using jq here, like select..any help or ref toa good doc would be much appriciated


Viewing all articles
Browse latest Browse all 657

Trending Articles



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