Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
Your team is conducting a post-incident root-cause analysis for an outage affecting a microservice deployed on Google Kubernetes Engine (GKE). During the investigation, you must use the Logs Explorer to query ingested logs for entries that meet the following strict criteria:
k8s_container)ERROR or higher2024-10-15T14:00:00Z and 2024-10-15T14:30:00ZjsonPayload.errorMessage matches either "connection refused" or "connection timeout" (case-insensitive)Which Logging query language expression should you execute in the Logs Explorer?
SELECT * FROM VIEW
WHERE resource.type = "k8s_container"
AND severity >= "ERROR"
AND timestamp BETWEEN "2024-10-15T14:00:00Z" AND "2024-10-15T14:30:00Z"
AND REGEXP_CONTAINS(jsonPayload.errorMessage, r'(?i)connection (refused|timeout)')
This statement is written in GoogleSQL syntax designed for Log Analytics (BigQuery-backed log buckets), rather than standard Logging query language used in the Logs Explorer filter pane.
SELECT * FROM .BETWEEN or REGEXP_CONTAINS functions directly in the default query bar.The scenario specifically required executing a SQL query over a Log Analytics-enabled log view or querying exported logs through BigQuery.
resource.type: "k8s_container" severity: "ERROR" timestamp = "2024-10-15T14:00:00Z" ... "2024-10-15T14:30:00Z" jsonPayload.errorMessage: ("connection refused" OR "connection timeout")
This expression uses simple substring/has (:) operators and range notation (...) rather than strict comparison operators and regular expressions.
severity: "ERROR" or severity = "ERROR" only returns log entries with exactly ERROR severity, omitting higher severities such as CRITICAL, ALERT, and EMERGENCY....) is not valid for timestamp fields in the Logging query language; explicit comparison operators (>= and <=) are required.: operator performs substring matching, it does not support regular expression evaluation across alternatives as efficiently or precisely as =~.: operator tests for token existence rather than evaluating an exact relational condition.The requirement was to perform a simple token search exclusively on ERROR severity logs without capturing higher severities or requiring exact regular expression syntax.
resource.type="k8s_container" severity >= ERROR timestamp >= "2024-10-15T14:00:00Z" AND timestamp <= "2024-10-15T14:30:00Z" jsonPayload.errorMessage =~ "(?i)connection (refused|timeout)"
In Google Cloud Observability, the Logging query language is the native expression syntax used within the Logs Explorer to evaluate, filter, and extract log entries from Cloud Logging buckets based on structured and unstructured attributes.
resource.type="k8s_container".DEFAULT, DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY). The comparison severity >= ERROR correctly matches all logs at ERROR level and above without having to enumerate each higher severity.timestamp field directly against RFC 3339 / ISO 8601 formatted string literals using comparison operators (>= and <=) joined by the AND operator.jsonPayload.errorMessage) and uses the regex comparison operator (=~) with the (?i) case-insensitive flag and regex pattern "(?i)connection (refused|timeout)".resource.type, severity, timestamp) to narrow scan volume rapidly before evaluating payload expressions.This expression correctly uses standard Logging query language syntax, avoiding SQL-specific constructs or invalid comparison operators that would fail validation in the standard Logs Explorer query pane.
resource_type = "k8s_container" severity = "ERROR+" timestamp >= TIMESTAMP_SUB("2024-10-15T14:30:00Z", INTERVAL 30 MINUTE) jsonPayload.errorMessage LIKE "%connection refused%" OR jsonPayload.errorMessage LIKE "%connection timeout%"
This option attempts to combine non-standard field names (resource_type), SQL timestamp calculation functions (TIMESTAMP_SUB), and SQL pattern matching (LIKE) within a Logging query language filter.
resource.type, not resource_type."ERROR+"; severity ordering must be expressed via comparison operators like >= ERROR.TIMESTAMP_SUB(); static bounds must be specified as quoted timestamp strings.LIKE Operator: The Logging query language uses =~ for regular expressions and : for substring search, not the SQL LIKE keyword.The Cloud Logging engine supported SQL functions and SQL dialect keywords natively in the search bar, which it does not.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated