Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
An administrator is troubleshooting an application running on Google Kubernetes Engine (GKE) using the Logs Explorer in the Google Cloud console.
The administrator needs to construct a query that filters log entries to meet the following criteria:
k8s_container).ERROR or more critical."Database connection timeout" within the JSON payload's message field.Which Logging Query Language (LQL) query should the administrator use in the Logs Explorer?
Logging Query Language (LQL) is the dedicated query syntax used within Google Cloud's Logs Explorer and the Cloud Logging API. It allows administrators and engineers to perform fast, structured searches across high volumes of ingested log records using resource descriptors, severity rankings, log names, timestamps, and payload attributes.
resource.type = "k8s_container" explicitly restricts the scope of the log search to Google Kubernetes Engine container workloads, ignoring logs from cluster masters, nodes, or other unrelated Google Cloud resources.severity >= ERROR leverages Cloud Logging's numerical severity scale (e.g., DEFAULT, DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY). Using >= ERROR returns entries marked as ERROR as well as any higher-severity logs (such as CRITICAL or EMERGENCY).jsonPayload.message = "Database connection timeout" directly evaluates the nested message property inside the structured jsonPayload object for an exact text match.AND operators ensure that all three conditions must evaluate to true for a log record to appear in the results.jsonPayload avoids scanning entire unstructured payloads, preventing false positive matches across other metadata fields.>= simplify filtering by capturing all critical failure levels without having to write multiple OR statements.resource.type and indexed fields enables the Cloud Logging search backend to quickly prune non-matching log streams.This query accurately applies native LQL syntax, combines filters using the logical AND operator, and queries structured fields at the appropriate hierarchy (jsonPayload.message) to isolate the required incident logs with minimal overhead.
This expression uses the logical OR operator across the conditions and uses a regular expression comparison operator (=~) on the payload message.
OR operator returns any log that matches at least one condition. This means it would return all logs from any service with severity ERROR, and all logs from k8s_container regardless of severity or message content. The scenario requires logs that satisfy all criteria simultaneously, necessitating AND.severity = "ERROR", the query checks only for exact equality with the string "ERROR" and misses entries of higher severity (e.g., CRITICAL, ALERT, EMERGENCY), failing the requirement for "ERROR or more critical".=~ invokes regular expression matching, which is computationally heavier than the standard equality operator (=) when performing an exact string match.OR operator expands query results, whereas AND narrows search scope.>= ERROR matches all severities at or above ERROR.= or : rather than regular expression evaluation (=~).The requirement was to find logs matching any of three independent criteria, including warning-level container logs or error logs from other services.
This expression uses programming language operators (&&, ==) and hypothetical field names (type, log_level, payload) commonly seen in generic monitoring tools or custom code scripts.
AND (or whitespace), and field equality is denoted by a single equals sign (=) or colon (:), not && or ==.type, log_level, or payload. The correct standard fields are resource.type, severity, and jsonPayload (or textPayload).ERROR, WARNING, INFO) and do not require double quotes.LogEntry structure defined by the Google Cloud Logging API.You were writing application filtering logic in a language like JavaScript or Python against an unparsed in-memory log dictionary rather than querying Cloud Logging.
VIEW WHERE resource.type = "k8s_container" AND severity >= "ERROR" AND json_payload.message LIKE "%Database connection timeout%"This statement is written in GoogleSQL syntax, which is used in Cloud Logging's Log Analytics feature (as well as BigQuery Studio and connected analytics tools) rather than the standard Logs Explorer query pane.
SELECT, FROM, or WHERE clauses. Submitting standard SQL in the primary Logs Explorer query bar will result in a syntax parsing error.json_payload (with an underscore) and parsed via JSON functions (such as JSON_VALUE), whereas standard LQL uses camelCase jsonPayload.message.LIKE '%...%' creates a wildcard pattern match rather than the direct field equality match requested in the scenario.The scenario required running aggregate analytics or SQL queries in the Log Analytics interface or BigQuery Studio on a Log Analytics-enabled bucket.
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