Associate Cloud Engineer ยท Logging and audit logs
What are the log buckets and how do you analyse them with SQL?
_Required and _Default buckets, user-defined buckets, retention, regionality, upgrading a bucket for Log Analytics and linked BigQuery datasets.
Key points
- _Required holds Admin Activity and System Event logs for a fixed 400 days. _Default holds everything else for 30 days by default; in a project its retention can be set from 1 to 3650 days.
- You can add user-defined buckets.
- A bucket's location cannot change after creation.
- Upgrade an unlocked project bucket to Log Analytics, then create a linked BigQuery dataset (a read-only view, one per bucket) to query it with SQL.
Source: https://docs.cloud.google.com/logging/docs/buckets
Practice questions
What is the retention of the _Required log bucket?
- 30 days, configurable
- 90 days, configurable
- 400 days, fixed
- 3650 days, configurable
Show answer
Answer: C. 400 days, fixed
_Required keeps logs for 400 days and this cannot be changed. The 30-day figure belongs to _Default.
Which statements about log buckets are correct?
- Retention of the _Required bucket cannot be changed
- A project's _Default bucket retention can be 1 to 3650 days
- A bucket's location cannot be changed after creation
- The _Required bucket keeps logs for 30 days
- One bucket can link to several BigQuery datasets
Show answer
Answer: A. Retention of the _Required bucket cannot be changed, B. A project's _Default bucket retention can be 1 to 3650 days, C. A bucket's location cannot be changed after creation
_Required retention is fixed, a project's _Default retention can be set between 1 and 3650 days, and the location of a bucket is fixed at creation. _Required is not 30 days, and a bucket links to at most one dataset.
True or false: a linked BigQuery dataset is a writable copy of the log data that you can load other tables into.
Show answer
Answer: False
False. A linked dataset is a read-only view of the log bucket's data; it does not copy the data and you cannot write to it.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
