返回顶部
l

log-dive日志深潜

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.3
安全检测
已通过
756
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

log-dive

Log Dive — Unified Log Search 🤿

Search logs across Loki, Elasticsearch/OpenSearch, and AWS CloudWatch from a single interface. Ask in plain English; the skill translates to the right query language.

⚠️ Sensitive Data Warning: Logs frequently contain PII, secrets, tokens, passwords, and other sensitive data. Never cache, store, or repeat raw log content beyond the current conversation. Treat all log output as confidential.

Activation

This skill activates when the user mentions:

  • - "search logs", "find in logs", "log search", "check the logs"
  • "Loki", "LogQL", "logcli"
  • "Elasticsearch logs", "Kibana", "OpenSearch"
  • "CloudWatch logs", "AWS logs", "log groups"
  • "error logs", "find errors", "what happened in [service]"
  • "tail logs", "follow logs", "live logs"
  • "log backends", "which log sources", "log indices", "log labels"
  • Incident triage involving log analysis
  • "log-dive" explicitly

Permissions

CODEBLOCK0

Example Prompts

  1. 1. "Find error logs from the checkout service in the last 30 minutes"
  2. "Search for timeout exceptions across all services"
  3. "What log backends do I have configured?"
  4. "List available log indices in Elasticsearch"
  5. "Show me the labels available in Loki"
  6. "Tail the payment-service logs"
  7. "Find all 5xx errors in CloudWatch for api-gateway"
  8. "Correlate errors between user-service and payment-service"
  9. "What happened in production between 2pm and 3pm today?"

Backend Configuration

Each backend uses environment variables. Users may have one, two, or all three configured.

Loki
VariableRequiredDescription
INLINECODE0YesLoki server URL (e.g., http://loki.internal:3100)
INLINECODE2
No | Bearer token for authentication |

| LOKI_TENANT_ID | No | Multi-tenant header (X-Scope-OrgID) |

Elasticsearch / OpenSearch
VariableRequiredDescription
INLINECODE5YesBase URL (e.g., https://es.internal:9200)
INLINECODE7
No | Basic <base64> or Bearer <token> for auth |

AWS CloudWatch Logs
VariableRequiredDescription
INLINECODE10 or INLINECODE11YesStandard AWS credentials
INLINECODE12
Yes | AWS region for CloudWatch |

Agent Workflow

Follow this sequence:

Step 1: Check Backends

Run the backends check to see what's configured:

CODEBLOCK1

Parse the JSON output. If no backends are configured, tell the user which environment variables to set.

Step 2: Translate the User's Query

This is the critical step. Convert the user's natural language request into the appropriate backend-specific query. Use the query language reference below.

For ALL backends, pass the query through the dispatcher:

CODEBLOCK2

Step 3: List Available Targets

Before searching, you may need to discover what's available:

CODEBLOCK3

Step 4: Tail Logs (Live Follow)

CODEBLOCK4

Tail runs for a limited time (default 30s) and streams results.

Step 5: Analyze Results

After receiving log output, you MUST:

  1. 1. Identify unique error types — group similar errors, count occurrences
  2. Find the root cause — look for the earliest error, trace dependency chains
  3. Correlate across services — if errors in service A mention service B, note the dependency
  4. Build a timeline — order events chronologically
  5. Summarize actionably — "The checkout service started returning 500s at 14:23 because the database connection pool was exhausted (max 10 connections, 10 in use). The pool exhaustion was triggered by a slow query in the inventory service."

NEVER dump raw log output to the user. Always summarize, extract patterns, and present structured findings.

Discord v2 Delivery Mode (OpenClaw v2026.2.14+)

When the conversation is happening in a Discord channel:

  • - Send a compact incident summary first (backend, query intent, top error types, root-cause hypothesis), then ask if the user wants full detail.
  • Keep the first response under ~1200 characters and avoid dumping raw log lines in the first message.
  • If Discord components are available, include quick actions:
- Show Error Timeline - Show Top Error Patterns - Run Related Service Query
  • - If components are not available, provide the same follow-ups as a numbered list.
  • Prefer short follow-up chunks (<=15 lines per message) when sharing timelines or grouped findings.

Query Language Reference

LogQL (Loki)

LogQL has two parts: a stream selector and a filter pipeline.

Stream selectors:
CODEBLOCK5

Filter pipeline (chained after selector):
CODEBLOCK6

Structured metadata (parsed logs):
CODEBLOCK7

Common patterns:

  • - Errors in service: INLINECODE16
  • HTTP 5xx: INLINECODE17
  • Slow requests: INLINECODE18
  • Stack traces: INLINECODE19

Elasticsearch Query DSL

Simple match:
CODEBLOCK8

Boolean query (AND/OR):
CODEBLOCK9

Time range filter:
CODEBLOCK10

Wildcard / regex:
CODEBLOCK11

Common patterns:

  • - Errors in service: INLINECODE20
  • HTTP 5xx: INLINECODE21
  • Aggregate by field: Use "aggs" — but prefer simple queries for agent use

CloudWatch Filter Patterns

Simple text match:
CODEBLOCK12

JSON filter patterns:
CODEBLOCK13

Negation and wildcards:
CODEBLOCK14

Common patterns:

  • - Errors: INLINECODE23
  • Errors in service: INLINECODE24
  • HTTP 5xx: INLINECODE25
  • Exceptions: INLINECODE26

Output Format

When presenting search results, use this structure:

CODEBLOCK15

Common Workflows

Incident Triage

  1. 1. Check backends → search for errors in affected service → search upstream/downstream services → correlate → build timeline → recommend actions.

Performance Investigation

  1. 1. Search for slow requests (duration > 5s) → identify common patterns → check for database slow queries → check for external service timeouts.

Deployment Verification

  1. 1. Search for errors in the deployed service since deploy time → compare error rate with pre-deploy period → flag new error types.

Limitations

  • - Read-only: This skill can only search and read logs. It cannot delete, modify, or create log entries.
  • Output size: Default limit is 200 entries. Log output is pre-filtered to reduce token consumption. For larger investigations, use multiple targeted queries rather than one broad query.
  • Network access: Log backends must be reachable from the machine running OpenClaw.
  • No streaming aggregation: For complex aggregations (percentiles, rates), consider using your backend's native UI (Grafana, Kibana, CloudWatch Insights).

Troubleshooting

ErrorCauseFix
"No backends configured"No env vars setSet LOKI_ADDR, ELASTICSEARCH_URL, or configure AWS CLI
"logcli not found"
logcli not installed | Install from https://grafana.com/docs/loki/latest/tools/logcli/ | | "aws: command not found" | AWS CLI not installed | Install from https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html | | "curl: command not found" | curl not installed | apt install curl or brew install curl | | "jq: command not found" | jq not installed | apt install jq or brew install jq | | "connection refused" | Backend unreachable | Check URL, VPN, firewall rules | | "401 Unauthorized" | Bad credentials | Check LOKI_TOKEN, ELASTICSEARCH_TOKEN, or AWS credentials |
Powered by Anvil AI 🤿

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 log-dive-1776420066 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 log-dive-1776420066 技能

通过命令行安装

skillhub install log-dive-1776420066

下载

⬇ 下载 log-dive v0.1.3(免费)

文件大小: 21.97 KB | 发布时间: 2026-4-17 20:10

v0.1.3 最新 2026-4-17 20:10
Rebrand to Anvil AI. Remove CacheForge marketing copy. Normalize install commands.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部