Skip to content

Guide · Agent skill

How to use the Cloud Logging Query Writer agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains how to install and use the cloud-logging-query-generation skill, which lets an AI agent turn a plain-English request into a Cloud Logging query written in Logging Query Language (LQL). It is for engineers, platform and security staff, and anyone new to Cloud Logging who needs a correct query without memorising the syntax. By the end you will know what the skill does, how to add it to your agent, how to phrase requests, and what to check before trusting the output.

Cloud Logging Query Writergoogle/skills · Apache-2.0

Quick start

  1. 1Download the ZIP. Download the skill ZIP from this page.
  2. 2Unzip the skill folder. Unzip it into ~/.claude/skills/ for personal use, or into the project's .claude/skills/ folder.
  3. 3Or upload in the Claude apps. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
  4. 4Ask a logging question. Describe the logs you need in plain English, naming the Google Cloud service if you can.
  5. 5Check the query. Replace any placeholders and run the query in Cloud Logging to confirm the results.

What the skill makes the agent do

An agent skill is a folder of instructions and reference files that an AI agent reads when a task matches the skill's description. With this skill installed, the agent writes Cloud Logging queries in Google's Logging Query Language from a request such as finding errors from a Cloud Run service or audit events for a deleted resource.

The skill asks the agent to follow fixed syntax rules: double quotes for strings, capitalised AND, OR and NOT, and parentheses to group conditions. It also tells the agent to look up the correct resource.type in per-service reference files rather than guess, and not to add filters for details you did not give. The output is the raw query text, with short comments where needed.

Install the skill

Download the ZIP from this page and unzip it. Then place the folder in one of these locations, depending on how you want to use it:

  • Personal use across projects: unzip into ~/.claude/skills/
  • Single project: unzip into the project's .claude/skills/ folder
  • Claude apps: upload the ZIP under Settings → Capabilities → Skills

Know what you need before you start

You need a Google Cloud project with Cloud Logging access so you can run the generated queries. The gcloud CLI is optional; it is only referenced for the attribution prefix when commands are run in a terminal. The skill does not run scripts and does not use the network itself.

Trigger the skill with natural requests

Ask for the log data you want in ordinary language. The skill applies when you need to query log data or are debugging an issue. Name the Google Cloud service where you can, because the agent uses the service's reference file to pick the right resource type and log ID. Leave out details you do not know; the agent is designed not to invent filters for them.

  • Show errors from the payments Cloud Run service in the last hour
  • Find audit events showing who deleted a Cloud Storage bucket
  • Find Compute Engine instance logs for the instance named my-instance

Read the output and check it

Generated queries are unverified until you run them against real logs. Paste the query into the Logs Explorer or run it with gcloud, then confirm the results match what you expected. If a query uses SEARCH, the skill requires a comment at the top saying a global keyword search was used because the exact schema was not in its references, so treat those results with more care.

Placeholders such as <PROJECT_ID> appear only where a value is strictly required. Replace them before running the query.

Safety notes on scripts and network

The skill runs no scripts and uses no network access. When commands are run directly in a terminal, the skill asks the agent to set the CLOUDSDK_METRICS_REQUEST_ATTRIBUTION variable inline on each gcloud command, rather than using gcloud config set, so the tag does not persist. The skill says this tag never goes into generated scripts, Terraform or user code.

CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:cloud-logging-query-generation)" \ gcloud <command> [flags]

Tips for better results

The skill is strongest when the request names a service and a clear event. It is not meant for querying SQL or Cloud Spanner databases, and its query text only works in Cloud Logging. Its accuracy depends on the agent being able to read the bundled reference files, so make sure those files are available in your environment.

  • Name the service, such as Cloud Run, Cloud SQL or BigQuery
  • For audit questions, say who acted and on which resource
  • Give a project ID or time range only when you know it
  • Run the query and compare results before using it in an incident

What people use it for

  • Find errors from a Cloud Run service during an incident
  • Search audit logs for who changed or deleted a resource
  • Build a query for a Cloud Storage or BigQuery event without memorising resource types
  • Teach a new team member the correct resource.type and log_id values for a service

Frequently asked questions

How do I install the cloud logging query generation skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.

What do I need to use this skill?

You need a Google Cloud project with Cloud Logging access to run the generated queries. The gcloud CLI is optional and is only referenced for the attribution prefix when commands run in a terminal.

Is the Cloud Logging query writer skill free?

The source gives its licence as Apache-2.0. It does not state pricing, so check the licence terms and your own Google Cloud costs for running queries.

Can this skill query SQL or Cloud Spanner databases?

No. The skill is explicitly limited to Cloud Logging and excludes querying other databases such as SQL or Cloud Spanner.

Does the skill run scripts or access the network?

According to the listing, it runs no scripts and uses no network. Generated queries still need to be run by you against your logs.

Why does the generated query contain SEARCH or a placeholder?

SEARCH is used when the exact field is not in the reference files, and the query then includes a comment saying so. Placeholders like <PROJECT_ID> appear only where a value is strictly required, and you should replace them before running the query.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits engineers debugging production issues, platform and security staff searching audit logs, and teams new to Cloud Logging who need correct resource types. It is not suited to SQL or Cloud Spanner queries, or to environments where the agent cannot read the bundled reference files. Always run the generated query and check the results before relying on it.

Download the skill