I'm using the below which is working perfectly but I want to add one more variable to the filtering, preferably "contains" as I want to filter this one based on a OS field which contains different strings:
curl -H "Accept: application/json; indent=4" -H "Authorization: Token $token" "$url_devices" -k | jq -r --arg device "$device" '.results[] | select(.cluster.name == $cluster) | .primary_ip.address'
Thank you in advance! I tried the following code, but it didn't work:
curl -H "Accept: application/json; indent=4" -H "Authorization: Token $token" "$url_devices" -k | jq -r --arg device "$device" '.results[] | select(.cluster.name == $cluster AND .cluster.os == $os) | .primary_ip.address'