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

Automated backups audit logs missing

We've had daily automated backups for our Cloud SQL instances for a few years now, but when I try to query for the automated backups events, they only seem to appear for the past few months. We kept our audit log settings to 400 day retention, and only seem to be able to find older events for manually triggered backups. Has anyone else encountered this? Was there a syntax change sometime over the past few months? 

I am using this page as reference: https://cloud.google.com/sql/docs/postgres/backup-recovery/view-audit-logs-for-automated-backups

0 1 381
1 REPLY 1

The functionality for viewing an audit log for an automated backup of an instance was introduced on January 18, 2023. See Release Note - https://cloud.google.com/sql/docs/release-notes

This might be the reason why you can only see automated backup events in the audit logs from the past few months and not for the entire duration of your backup history​

If you have specific audit log queries that you were using before this date and they are no longer working, it might be because of this change. The introduction of a new feature like this could have come with changes to the structure or syntax of the logs.

However, it's also worth noting that the retention period for audit logs in Google Cloud is determined by the configuration of your logging exports and not by the Cloud SQL service itself. The default retention period is 400 days, but logs older than 30 days are not guaranteed to be available unless you have configured exports to a either Cloud Storage or BigQuery. If you have not done so, it might be worth setting up log exports to ensure that you have access to your logs for as long as you need them.