Skip to content
-
Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
Close

Search

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

Mind and Script Mind and Script Mind and Script

Deep Thoughts, Clean Thoughts

  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
  • Home
  • Life
    • Lifestyle
    • Mental Health
    • Personal Growth
    • Philosophy
    • Professional Growth
    • Psychology
  • Books
  • Writing
    • AI Writing
    • Technical Writing
  • Movies
  • Travel
    • Day Trips
    • Food
    • Itineraries
    • World
  • Technology
Close

Search

Google-Cloud-Log-Sinks

A Quick Look at Google Cloud Log Sinks

October 2, 2025 3 Min Read
0

Route Your Logs, Your Way

Obtaining log data is crucial for maintaining the health and security of your applications. But all that data needs to go somewhere useful! This is where Google Cloud Log Sinks come in. Think of them as the traffic cops for your Google Cloud Platform (GCP) logs, directing specific log entries to the right destination.

What is a Log Sink?

A Log Sink is a configuration within Cloud Logging’s Log Router that defines which log entries to export and where to send them.

Every log entry generated by your Google Cloud services (like Compute Engine, Cloud Run, etc.) first passes through the Log Router. The Log Router checks each log entry against all your active sinks. If a log entry matches a sink’s filter, it gets routed to that sink’s destination.

Key Components:

  • Source: Logs from your Google Cloud projects, folders, billing accounts, or organization.
  • Filter: A rule (using the Logging query language) that selects specific logs to export (e.g., only “ERROR” severity logs, or logs from a specific resource).
  • Destination: The Google Cloud service where the selected logs are sent.
  • Supported Destinations: You can route your logs to various Google Cloud services for different purposes:

Google Cloud Log Sinks
Google Cloud Log Sinks

Use Cases and Scenarios

Log Sinks are essential for governance, security, and advanced analytics:

  • Security & Compliance: Route all Audit Logs and high-severity “CRITICAL” logs to a centralized BigQuery dataset or a protected Cloud Storage bucket for long-term retention and security analysis.
  • Real-time Alerting: Send all “ERROR” and “WARNING” logs from your production environment to a Pub/Sub topic. A service can subscribe to this topic to trigger immediate alerts (like sending a message to PagerDuty or Slack).
  • Centralized Logging: If you have many projects, you can use an Aggregated Sink at the Folder or Organization level to collect logs from all child projects and send them to a single Log Bucket in a dedicated “logging” project.

Simple Steps to Set Up a Log Sink

Here is the quick process to create a sink that exports all logs with ERROR severity to a BigQuery dataset:

1. Prepare the Destination:

  • Go to BigQuery and create a new Dataset (e.g., prod_errors_dataset).

2. Navigate to Logs Router:

  • In the Google Cloud Console, go to Logging => Logs Router.

3. Create the Sink:

  • Click CREATE SINK.
  • Sink Details: Give it a clear name (e.g., export-prod-errors). Click NEXT.

4. Select Destination:

  • Select BigQuery dataset from the “Select sink service” dropdown.
  • Select the destination dataset you created (e.g., prod_errors_dataset). Click NEXT.

5. Build the Filter:

  • In the Choose logs to include in sink panel, define your filter. For all errors, use:
severity = ERROR
  • Optional: You can also add Exclusion Filters to discard noisy logs before they are exported. Click CREATE SINK.

6. Grant Permissions:

  • After creation, Cloud Logging provides a unique Writer Identity (a service account email) for the new sink.
  • You must grant this writer identity the necessary role on the BigQuery destination to allow it to write data (in this case, the BigQuery Data Editor role). The console usually prompts you or provides the command.
  • Once set up, any new log entry with severity = ERROR will be instantly routed to your BigQuery table for querying and analysis.

Want to know more on which Destination to select?

💡 Mind and Script Weekly

Join other engineers and writers. No spam, just substance.

Disclaimer: This post may contain affiliate links. If you click and buy, we may receive a small commission at no extra cost to you. Read our full disclosure here.

Tags:

GCPGoogle Cloud Platform
Author

Rajesh Mishra

I'm a developer who loves sharing insights, technical how-tos, and lessons learned from the world of code. While much of what I write may not be groundbreaking, I believe in documenting for future me—and for anyone else who might find it useful. Beyond tech, I also dive into life's experiences and moments, reflecting on personal growth and sharing stories that resonate. Whether you're here for practical tips or a fresh perspective on life, I hope you find something meaningful.

Follow Me
Other Articles
1sHMvjrCKMZMQqT1DW5m9GQ
Previous

Your Technical Documentation is a Conversational Interface

Colorful UNO Flip game cards displayed
Next

UNO: Your Exciting Guide to Fun Rules Unleashed!

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Hyderabad Traffic
  • 5 Best Books to Read After a Breakup
  • 5 Movies to Stream This Valentine’s Day If You’re Single
  • Self-Care: A Guide to Solo Valentine’s Day
  • Using GitHub Actions for Google Cloud Run

Recent Comments

  1. Sneha on Smartphones: Friend or Foe?

Important Links

  • Affiliate Disclosure
  • Privacy Policy
  • Terms of Use
© Copyright 2026 — Mind and Script. All rights reserved.