I have been in DevOps related jobs for past 6 years dealing mainly with Kubernetes in AWS and on-premise as well. I spent quite a lot …
:date_long | 1 min Read
How to use regexp with jq
How to use regexp within jq
when selecting documents
PROJECT_NAMES="one|two|there"
REGEXP_SOL_PROJ="^prefix-${ENVIRONMENT}-(${PROJECT_NAMES}).*"
REGION="europe-west3"
HSM_PROJ=$(gcloud projects --format=json list | jq -r --arg RGEXP "^eaut-${ENVIRONMENT}-hsm-dap-kernel.*$" '.[] | select(.projectId|test($RGEXP)) | .projectId')
Links:
202406171306