Google Associate Cloud Engineer Question 294
Select 3Google Cloud PlatformAs a Google Certified Associate Cloud Engineer, you are tasked with exporting logs from Cloud Logging to an external system for long-term analysis and storage. Which of the following steps are required to set up log export using Log Sinks in Google Cloud Platform?
- A
Create a Cloud Storage bucket for storing the exported logs.
- B
Configure a Cloud Pub/Sub topic as the export destination.
- C
Define a filter for selecting which logs to export.
- D
Grant the required IAM roles to the service account associated with the log sink.
- E
Enable the Stackdriver Logging API.
Show answer and explanation
Correct answers: A, C, D
Explanation
To export logs using Log Sinks in Google Cloud, you must define a filter to specify which logs to export and grant the necessary permissions to the service account so it can write to the export destination. While choosing a specific destination (like Cloud Storage, Pub/Sub, or BigQuery) is part of the setup, creating a Cloud Storage bucket is only necessary if you choose it as the destination. Similarly, configuring a Cloud Pub/Sub topic is only required if it's the chosen destination. Therefore, the core steps involve setting up the filter and permissions.
- A. Correct.
Creating a Cloud Storage bucket is a valid destination for log exports, but it's not mandatory if another destination is chosen.
- B. Incorrect.
A Cloud Pub/Sub topic can be used as a destination for log exports, but configuring it is not mandatory unless you choose it as your target.
- C. Correct.
Defining a filter is necessary to determine which logs should be exported from the logging service.
- D. Correct.
Granting the required IAM roles ensures that the service account can write logs to the destination.
- E. Incorrect.
Enabling the Stackdriver Logging API is unrelated to the process of setting up log sinks, as the necessary APIs for logging are usually already enabled.