Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Mailing backup reports in backup and DR

Hi All,

 

Is there a way we can get reports of the failed backup from the backup and DR service in GCP via mails

6 2 351
2 REPLIES 2

Absolutely!  You can configure Cloud Logging to monitor logs from Backup and DR, and then route to any supported alert destination.  An example query to hit on failed snapshots might look like:

 
jsonPayload.errorMessage=~"Failed snapshot"
logName=~"backupdr.googleapis.com%2Fbackup_recovery_appliance_events"
severity>=ERROR

If you wanted to just alert on all Backup and DR appliance errors, you could omit the "Failed snapshot" query component.

Once you have the query configured, then you could decide to just alert immediately, or you could define a log-based metric and alert on some threshold such as 5 errors or more per hour.  Alert destinations can not only include email, but also Google Chat, Slack, Webhooks, SMS, Pub/Sub, and more.

References:

Thanks John that was helpful how do we display the Error message and the app name in the alert documentation or add as a label, i am not able to create the correct regex expression

 

Error 400: Field alert_policy.conditions[0].label_extractors had an invalid value of "vmname": REGEXP_EXTRACT(jsonPayload.appName, "([\w-]+)") is not a well-formatted label extractor in projects/gcp-mgmt-vpc-01: Failed to parse extractor expression: syntax error at line 1, column 37, token '"([\w-]+)"'