Bitzu

Associate Cloud Engineer ยท Logging and audit logs

How does the Log Router send logs elsewhere?

Sinks, inclusion and exclusion filters, destinations (BigQuery, Cloud Storage, Pub/Sub, log buckets), writer identity, aggregated sinks, exporting to on-premises via Pub/Sub.

Key points

  • Through sinks: one inclusion filter, optional exclusion filters and a destination.
  • Destinations: log bucket, BigQuery dataset, Cloud Storage bucket, Pub/Sub topic or another project.
  • Writer identity (service account): needs write permission on the destination.
  • Sinks only route new entries.
  • Aggregated sinks at folder or organization level (--include-children) cover child projects.
  • Pub/Sub: route to external or on-premises tools.

Source: https://docs.cloud.google.com/logging/docs/routing/overview

Practice questions

Single choice

Which of these is NOT a supported destination for a log sink?

  1. A BigQuery dataset
  2. A Pub/Sub topic
  3. A Cloud SQL database
  4. A Cloud Storage bucket
Show answer

Answer: C. A Cloud SQL database

Sinks can write to log buckets, BigQuery, Cloud Storage and Pub/Sub. Cloud SQL is not a sink destination.

Select all that apply

Which statements about log sinks are correct?

  1. A sink with an empty filter routes all log entries
  2. An entry matching an exclusion filter is not routed by that sink
  3. A new sink does not route entries written before it was created
  4. The _Required sink can be edited to add exclusion filters
  5. A new sink copies the last 30 days of logs to its destination
Show answer

Answer: A. A sink with an empty filter routes all log entries, B. An entry matching an exclusion filter is not routed by that sink, C. A new sink does not route entries written before it was created

A sink with no filter routes everything, exclusion filters remove entries that match them, and sinks never back-fill past entries. The _Required sink cannot be edited, and sinks do not export history.

True or false

True or false: creating a sink also exports the log entries that were already stored before the sink existed.

Show answer

Answer: False

False. Sinks cannot retroactively route entries; only entries written after the sink exists are sent.

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.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module