jq search node name which starts with

curl -k --location --request GET 'http://127.0.0.1/api_jsonrpc.php' --header 'Content-Type: application/json' --data '{
    "jsonrpc": "2.0",
    "method": "template.get",
    "params": {
        "output": ["host"]

    },
    "auth": "6826483944988456b0d4524358d9e83c",
    "id": 1
}
' | jq '.result[] | select(.host | startswith("Linux"))'

No comments: