cloud-logging-query-generation
Generates Logging Query Language (LQL) queries for Cloud Logging on Google Cloud from natural language. Use this skill when you need to query log data or when you are debugging issues. You can filter log data by Google Cloud service. Don't use this skill to query other databases, such as SQL or Clou
- 0
- Installs
- —
- Rating
- —
- Success rate
- 23
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 29249745f894aaf9… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Generate Logging Query Language queries
Use this skill to generate correct Logging Query Language (LQL) queries for Cloud Logging.
Core rules
-
Strict syntax requirements:
- Always use double quotes (
") for string literals. Do not use single quotes ('). - Write boolean operators in all capitals:
AND,OR,NOT. - Always use parentheses to group terms and explicitly enforce precedence.
- Always use double quotes (
-
Common pitfalls:
- Instance ID vs. Instance Name: For the
gce_instanceresource type, do NOT compare instance names to instance IDs. Instance names are strings (for example,my-instance). Instance IDs are numeric. If you only have the name, then search by instance name,SEARCH("my-instance"), or useresource.labels.instance_nameif that label is available for the resource. - Resource Type Accuracy: Do not guess resource types. You must look
up the correct
resource.typevalue in the service-specific reference files. For example, useinternal_http_lb_rulefor Internal HTTP(S) Load Balancer rules when filtering by forwarding rule name or region (instead ofhttp_load_balancer).
- Instance ID vs. Instance Name: For the
-
Output format and placeholders:
- Output only the raw LQL query text. Do not include conversational
filler. Do not wrap the query in markdown code blocks unless explicitly
requested by the user. Valid LQL comments (using
--) are allowed, and are the ONLY acceptable way to include explanations or warnings. - Never block on missing variables. If the user's request lacks
specific identifiers (like a project ID, instance name, or IP address),
do not ask them for clarification. If the variable is required for a
functional query (like a log bucket name for a regional log), insert an
uppercase placeholder string wrapped in angle brackets (for example,
"<PROJECT_ID>"). CRITICALLY: If you include a placeholder for a variable the user omitted, it will act as an explicit filter that causes logs to be missed. Therefore, you MUST omit the entire filter/line containing the placeholder if the field is not strictly required. For example, completely omitresource.labels.instance_id="..."if the user didn't specify an instance, but you MUST includelogName=".../projects/<PROJECT_ID>/..."with a placeholder if constructing a regional log bucket query where a project ID is strictly required.
- Output only the raw LQL query text. Do not include conversational
filler. Do not wrap the query in markdown code blocks unless explicitly
requested by the user. Valid LQL comments (using
-
Preferred fields:
- Include
resource.typeandlog_idrestrictions when the query targets specific Google Cloud services or resources. Global queries (for example, "latest error logs") do not require these restrictions.
- Include
Detailed reference
Refer to references/api_reference.md for LQL syntax rules, including
Operators, NULL handling, SEARCH, and Regex.
Service reference files
Before generating a query, you MUST read the examples for the specific service.
LQL schemas and resource.type values are service-specific. Do not stop
reading after finding the Base Schema in the file. You must verify if there are
specific requirements for state tracking (like previousState) or
resource-specific log IDs detailed in the paragraphs or specific query examples
below the schema block.
For the following services, read the exact file listed:
- App Engine
- BigQuery
- Cloud Deployment Manager
- Cloud Functions
- Cloud Observability (Monitoring, Logging, Trace)
- Cloud Run
- Cloud Source Repositories
- Cloud Spanner
- Cloud SQL
- Cloud Storage
- Cloud Tasks
- Compute Engine (GCE)
- Dataflow
- Dataproc
- Kubernetes Engine (GKE)
- IAM & Service Accounts
- Networking (VPC, Load Balancing, and others)
- Security (Audit logging)
- Service Usage (Enable/Disable API, Quotas)
- Third Party (for example, Nginx, Apache)
For Google Cloud services that aren't listed: If the service is not listed above, write the LQL query based on your general knowledge.
Query generation rules
- Resource Types: Explicitly define the
resource.typein your queries when focusing on specific services. For some queries, you may need to search across multiple types (for example,resource.type=("bigquery_project" OR "bigquery_dataset")). - Audit and Admin Logs: If the user asks for audit logs, admin logs, API
logs, or logs about who created, updated, deleted, read, or accessed a
resource:
- You MUST read
references/query_audit_logs.md for the
correct
protoPayloadschema paths and common examples. - If a specific example is not listed, guess the
protoPayload.methodNameby combining the service and verb. When guessing, you MUST use the scopedSEARCH()function (e.g.,SEARCH(protoPayload.methodName, "compute.instances.insert")) instead of the exact match operator (=) to avoid version prefix mismatches. Do NOT use the colon operator (:) as it may cause substring false positives. - For generic API enable/disable events (e.g., a service was disabled),
always use
resource.type="audited_resource".
- You MUST read
references/query_audit_logs.md for the
correct
- Handling Unknown Schemas (Crucial): If the user asks to filter by a
specific field or condition, and if you cannot find a matching example or
schema in the reference files, then you must generate a query using global
search.
- Only specify
jsonPayload.*orprotoPayload.*field structures when you are certain of their exact name. - Use the
SEARCH()function to find the keyword globally within the correctresource.type. - Mandatory LQL Comment: When delivering a query that uses
SEARCH, you MUST add an LQL comment (using--) at the top of the query indicating you used a global keyword search because the exact schema wasn't in your references. Do NOT output conversational text, strictly adhere to the Output Format rule.
- Only specify
Supporting links
Files
23- SKILL.md
b888becb417.5 KB - references/api_reference.md
a8cc0538225.1 KB - references/query_app_engine.md
7fad9ea6c32.2 KB - references/query_audit_logs.md
399ecad1b58.2 KB - references/query_bigquery.md
1cb43034fa6.2 KB - references/query_cloud_functions.md
c220cebfff2.0 KB - references/query_cloud_observability.md
15fe11b2db1.4 KB - references/query_cloud_run.md
34b809e3241.9 KB - references/query_cloud_source_repositories.md
4ac8afab21229 B - references/query_cloud_sql.md
9604fd46d92.6 KB - references/query_cloud_storage.md
22f59b7b4c1.9 KB - references/query_cloud_tasks.md
09019176bf202 B - references/query_compute_engine.md
7050dc53f915.5 KB - references/query_dataflow.md
ecdf03c540224 B - references/query_dataproc.md
08c2ba0f10235 B - references/query_deployment_manager.md
5e7ee5b8ce753 B - references/query_gke.md
7b6160dbbb23.6 KB - references/query_iam.md
1492c668bd5.7 KB - references/query_networking.md
6cdf6e535a7.6 KB - references/query_security.md
744645cdf91.4 KB - references/query_service_usage.md
a6280300f6836 B - references/query_spanner.md
9acbd0ab9a244 B - references/query_third_party.md
d9fce81b1d4.1 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from google/skills8
Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for st
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available model
Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for run
Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results be
Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate c
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry
Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.
Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.
Related database skillsscan passed
Prisma ORM patterns for TypeScript backends — schema design, query optimization, transactions, pagination, and critical traps like updateMany returning count not records, $transaction timeouts, migrate dev resetting the DB, @updatedAt skipped on bulk writes, and serverless connection exhaustion. Use
Use when the user wants to provision infrastructure or third-party services using Stripe Projects. Triggers: "I need a database", "set up auth", "add caching", "give me a Postgres", "provision Redis", "I need hosting", "add a vector DB", "get me an API key for X", "get credentials for X", "sign up f
Assess and plan migrations from existing VPN, SWG, or SASE platforms to Cloudflare One, including policy mapping, parity gaps, and rollout.
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to
Builds and deploys Firebase SQL Connect (aka Firebase Data Connect) backends with PostgreSQL securely. Use when designing schemas with tables and relations, writing authorized queries and mutations, configuring real-time data updates, or generating type-safe SDKs. Use when you need a relational data
Amazon Redshift is NOT PostgreSQL — corrects PostgreSQL-derived LLM mistakes; covers Redshift-specific SQL, DDL, COPY/UNLOAD, system views, metadata discovery, and operational patterns. Applies ONLY when the task is about Redshift itself (cluster, Serverless workgroup, or Redshift SQL). Pushes back