I'm currently trying to filter a value from a long string I got by using a GET request with the cURL
command. The output looks like this:
{"errors":null,"result":{"host_id":"1632","display_name":"notshownhere","hostname":"notshownhere","dnsname":"","ip":"1.1.1.1","host_type_id":"1","checks":[{"check_id":"12851","preset_id":"1","checktype_id":"1","checktype_short_name":"ping","status":"3","status_condition":"ok","status_color":"green","status_change_time":"1589066121","result_short":"1.1.1.1 is alive","result_time":"1591683892"}
My aim is to filter out the host_id
from this output. This means, I want to find a way how I can only output the host_id
with the number 1632
.
I tried out Select-String
, but it didn't work because the string is too long.