I want to be able to filter multiple subscriptions when setting up GCP Alert. Can someone explain?
I can add multiple filter entries. But they are all combined with AND
. So all of them have to be met, and not I wanted.
Ex: Lets say I have subscription-1
, ad-subscription-1
, auto-subscription-2
, my-subscription-dev
.
I want to setup alerts for only auto-subscription-2
and my-subscription-dev
How to specify that in the filter criteria?
If you will be using your configuration form your previous question, click on Query Editor and it will show you the equivalent query of your current settings.
In the query, there is a line
| filter (resource.subscription_id == 'auto-subscription-2)
. Simply add||
and include your subscription you want to include in the filter. The whole line should look like this after applying the OR expression:The whole query should look like this:
NOTE:For testing purposes I originally have 3 subscriptions (test-sub,test-sub-2,test-sub-3) and I filtered test-sub and test-sub-3: