Get the FREE Ultimate OpenClaw Setup Guide →

Logging Tail

Scanned
npx machina-cli add skill yu-iskw/google-cloud-observability-plugin/logging-tail --openclaw
Files (1)
SKILL.md
985 B

Logs Tail

Stream logs in real-time.

Purpose

Watch live logs for immediate feedback during an incident or deployment.

Behavior

  1. Execute gcloud alpha logging tail [FILTER] --project=[PROJECT] --buffer-window=[BUFFER_WINDOW] --format=json.
  2. If project is not provided, use the active project from gcp-context.
  3. The --format=json flag is recommended for programmatic consumption.
  4. Stop streaming after the specified duration or when interrupted.

Inputs

  • project (optional): The Google Cloud project ID to tail logs from.
  • filter (optional): A valid Cloud Logging filter string.
  • buffer_window (optional): The duration of the buffer window for reordering logs (e.g., 5s).
  • duration (optional): How long to stream logs for in seconds. Defaults to 30s.

Output

Streams log entries (JSON formatted if requested) to the terminal.

References

Source

git clone https://github.com/yu-iskw/google-cloud-observability-plugin/blob/main/skills/logging-tail/SKILL.mdView on GitHub

Overview

Logs Tail streams live logs for immediate feedback during incidents or deployments. It runs gcloud alpha logging tail with optional filters, project, and buffer-window settings, with JSON formatting recommended for programmatic consumption.

How This Skill Works

It executes: gcloud alpha logging tail [FILTER] --project=[PROJECT] --buffer-window=[BUFFER_WINDOW] --format=json. If project is omitted, it uses the active project from gcp-context. Streaming continues until the specified duration elapses or you interrupt it, delivering JSON-formatted entries when requested.

When to Use It

  • During an incident to monitor fresh log entries as they happen
  • While validating a deployment rollout and verifying live logs
  • When filtering logs for a specific resource, service, or condition
  • To inspect logs from a specific project without switching contexts
  • When you need a time-bounded live stream (duration) for quick checks

Quick Start

  1. Step 1: Identify a filter and optional project (or rely on gcp-context)
  2. Step 2: Run the tail command with your filter and options, e.g., gcloud alpha logging tail [FILTER] --project=[PROJECT] --buffer-window=[BUFFER_WINDOW] --format=json
  3. Step 3: Stop with Ctrl+C or let the duration end to finish the stream

Best Practices

  • Use --format=json for easy programmatic parsing of log entries
  • Specify a meaningful filter string to narrow results
  • Provide buffer_window to help reorder asynchronous logs
  • Rely on the active project from gcp-context if project is not set
  • Limit streaming duration to avoid unnecessary resource use and capture only what you need

Example Use Cases

  • Tail prod error logs in real-time during an outage with a narrow filter
  • Monitor a new deployment's pod logs as it rolls out
  • Stream logs for a service using a filter like resource.type and labels
  • Capture a 60-second log stream to verify a short-lived incident
  • Use in CI/CD to quickly surface relevant logs after a build

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers