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

need jq parse certain text value and get its value [closed]

$
0
0

I have this JSON output from Zabbix.

I want to get value for last key , to only match ""name": "Zabbix agent availability", and get its "lastvalue" parameter. I'm unable to get it.Is there any way to do it?

[    {"itemid": "61462","name": "Available memory","key_": "vm.memory.size[available]","preprocessing": [],"lastvalue": "34071158784"    },    {"itemid": "61463","name": "Available memory in %","key_": "vm.memory.size[pavailable]","preprocessing": [],"lastvalue": "53.919516"    },    {"itemid": "61497","name": "Total memory","key_": "vm.memory.size[total]","preprocessing": [],"lastvalue": "63196020736"    },    {"itemid": "61507","name": "Memory utilization","key_": "vm.memory.utilization","preprocessing": [        {"type": "21","params": "return (100-value);","error_handler": "0","error_handler_params": ""        }      ],"lastvalue": "46.080484"    },    {"itemid": "61500","name": "Zabbix agent availability","key_": "zabbix[host,agent,available]","preprocessing": [],"lastvalue": "1"    }]

Viewing all articles
Browse latest Browse all 582

Latest Images

Trending Articles



Latest Images

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