Google Associate Cloud Engineer exam dumps

Google Associate Cloud Engineer practice question 301 of 375

Associate Cloud Engineer. Free level, Google Cloud. Free question with the correct answer and a full explanation.

Google Associate Cloud Engineer Question 301

Single answerGoogle Cloud Platform

As a Google Cloud Associate Cloud Engineer, you are tasked with analyzing logs to troubleshoot an issue with a specific application running on Google Kubernetes Engine (GKE). The application logs are being collected in Google Cloud Logging. You need to filter the logs to show only the ERROR level logs for the application 'my-app'. Which of the following queries would you use in the Logs Explorer to achieve this?

  1. A

    resource.type="gke_cluster" AND labels.k8s-pod/component="my-app" AND severity="ERROR"

  2. B

    resource.type="gke_cluster" AND logName="projects/my-project/logs/my-app" AND severity="ERROR"

  3. C

    resource.type="gce_instance" AND labels.app="my-app" AND severity="ERROR"

  4. D

    resource.type="gke_cluster" AND jsonPayload.message="ERROR" AND labels.k8s-pod/component="my-app"

Show answer and explanation

Correct answer: A

Explanation

Filtering logs in Cloud Logging requires specifying the correct resource type, labels, and log level. The correct query should filter logs for the specific GKE application component by using the appropriate labels and severity level. The first option correctly uses the GKE cluster resource type, labels the application's component, and filters for the 'ERROR' severity, making it the correct choice.

  • A. Correct.

    This option correctly filters logs for the GKE cluster resource type, includes the component label specific to 'my-app', and filters for logs with severity 'ERROR'.

  • B. Incorrect.

    This option incorrectly uses the logName field, which is not specific enough to filter by log severity or application component.

  • C. Incorrect.

    This option is incorrect because it specifies the GCE instance resource type instead of GKE cluster, which doesn't match the context of the application running on GKE.

  • D. Incorrect.

    This option incorrectly uses jsonPayload.message to filter for 'ERROR'; severity should be used instead when filtering by log level.

Timed practice exam

Take a Google Associate Cloud Engineer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam