0
0
GCPcloud~10 mins

Log Explorer and queries in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to filter logs by severity ERROR.

GCP
resource.type = "gce_instance" AND severity = "[1]"
Drag options to blanks, or click blank then click option'
AWARNING
BERROR
CDEBUG
DINFO
Attempts:
3 left
💡 Hint
Common Mistakes
Using INFO or DEBUG instead of ERROR.
Misspelling the severity level.
2fill in blank
medium

Complete the code to filter logs from Compute Engine instances.

GCP
resource.type = "[1]"
Drag options to blanks, or click blank then click option'
Aapp_engine
Bcloud_function
Ck8s_container
Dgce_instance
Attempts:
3 left
💡 Hint
Common Mistakes
Using resource types for other services like Cloud Functions.
Using incorrect resource type strings.
3fill in blank
hard

Fix the error in the query to filter logs with text payload containing 'error'.

GCP
textPayload [1] "error"
Drag options to blanks, or click blank then click option'
Ahas
Bcontains
CCONTAINS
Dcontains_substring
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'contains' which is invalid.
Using 'has' which is not a valid operator.
4fill in blank
hard

Fill both blanks to filter logs with severity WARNING or higher.

GCP
severity [1] WARNING OR severity [2] ERROR
Drag options to blanks, or click blank then click option'
A>=
B<=
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using <= which selects lower severities.
Using != which excludes specific severities.
5fill in blank
hard

Fill all three blanks to create a query filtering logs from Cloud Functions with severity ERROR and textPayload containing 'timeout'.

GCP
resource.type = "[1]" AND severity = "[2]" AND textPayload [3] "timeout"
Drag options to blanks, or click blank then click option'
Acloud_function
BERROR
CCONTAINS
Dgce_instance
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong resource type like gce_instance.
Using lowercase 'contains' instead of uppercase CONTAINS.
Using wrong severity level.