Hi Mark,
There are a couple of different ways to implement this, either scripting with grep/sed/awk or, as you suggested, pulling the output list as JSON and processing it with loops and conditionals in a programming language of your choice.
A simple approach would be to use the
command flags available when listing all the IAM policy for a given project. For instance, the following command:
`gcloud projects get-iam-policy $PROJECT_ID --flatten="bindings[].members" --format="table(bindings.members)" --filter="bindings.role:roles/owner"`
outputs all the users and service accounts associated with the role ‘roles/owner’ in the project in question.