PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #59
You are creating Cloud Logging sinks to export log entries from Cloud Logging to BigQuery for future analysis. Your organization has a Google Cloud folder named Dev that contains development…
The correct answer is D. Create an aggregated log sink in the Dev and Prod folders. To minimize the number of log sinks and ensure future projects are covered while directing Dev logs to dev_dataset and Prod logs to prod_dataset, create an aggregated log sink in both the Dev and Prod folders.
Question
Options
- ACreate a single aggregated log sink at the organization level.
- BCreate a log sink in each project.
- CCreate two aggregated log sinks at the organization level, and filter by project ID.
- DCreate an aggregated log sink in the Dev and Prod folders.
How the community answered
(57 responses)- A12% (7)
- B4% (2)
- C5% (3)
- D79% (45)
Why each option
To minimize the number of log sinks and ensure future projects are covered while directing Dev logs to `dev_dataset` and Prod logs to `prod_dataset`, create an aggregated log sink in both the Dev and Prod folders.
A single aggregated log sink at the organization level cannot direct logs to two separate BigQuery datasets (dev_dataset and prod_dataset) based on their folder origin simultaneously.
Creating a log sink in each project would not minimize the number of sinks and would require manual configuration for every new project, failing to apply to future projects automatically.
Creating two aggregated log sinks at the organization level and filtering by project ID is technically feasible but is generally more complex and less robust than using folder-level aggregated sinks, which inherently leverage the existing resource hierarchy for scope without needing manual filter maintenance based on project naming conventions.
Creating an aggregated log sink within the 'Dev' folder will automatically collect logs from all current and future projects within that folder and can be configured to export specifically to `dev_dataset`. Similarly, an aggregated sink in the 'Prod' folder will collect logs from all current and future production projects and export them to `prod_dataset`. This approach minimizes the total number of sinks (two for the entire organization) while adhering to the distinct destination requirements and automatically including future projects by leveraging the resource hierarchy.
Concept tested: Cloud Logging aggregated sinks and hierarchical log export
Source: https://cloud.google.com/logging/docs/export/aggregated_sinks
Topics
Community Discussion
No community discussion yet for this question.