analyselogs
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "analyselogs" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5b812c9f302072e4624b4245aae7ec846b8e5e37111e9552dd7d8a38ec1c011a. Verify the upstream source and version against https://skillhub.cn/skills/user_1d0f33ec/analyselogs before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Automatically analyzes log files, identifies error patterns, and generates a summary report in Markdown format.
Introduction source: third_party · user_1d0f33ec · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: log-analyzer
description: 自动分析日志文件,识别错误模式并生成 Markdown 摘要报告
metadata: {"clawdbot":{"emoji":"🔍","requires":{"dirs":["~/logs"]}}}🔍 Log Analyzer
log-analyzer 是一个自动化日志分析技能,能够扫描指定目录的日志文件,识别错误模式、异常和关键事件,并生成结构化的 Markdown 摘要报告。
使用场景
以下场景启用此技能:
- 用户提到「日志分析」「log analysis」「日志报错」「分析日志」
- 需要查看 ~/logs 目录下的错误和异常
- 需要生成日志摘要报告
- 需要快速定位日志中的关键问题
- 需要分析多个日志文件的模式和趋势
核心功能
- 自动扫描:遍历 ~/logs 目录,识别日志文件(.log、.txt、.json 等)
- 错误识别:提取 ERROR、FATAL、CRITICAL、Exception、Failed 等级别日志
- 模式匹配:识别重复出现的错误、高频异常
- 时间分析:按时间段统计错误分布
- 报告生成:输出结构化的 Markdown 报告
- 关键信息提取:提取错误代码、堆栈信息、相关请求 ID 等
日志目录结构
默认扫描目录:~/logs
支持的日志文件类型:
.log文件.txt文件.json日志- 压缩日志:
.gz、.zip(需要先解压) - 自定义扩展名(用户可指定)
错误级别识别
按优先级识别以下日志级别:
| 级别 | 关键词 | 优先级 |
|---|---|---|
| 致命 | FATAL, CRITICAL | P0 |
| 错误 | ERROR, Err | P1 |
| 警告 | WARN, WARNING | P2 |
| 异常 | Exception, Failed, Failed to | P3 |
| 其他 | 自定义关键词 | P4 |
使用示例
基本日志分析
用户输入:帮我分析 ~/logs 下的日志,找出所有错误
流程:
- 扫描 ~/logs 目录,识别所有日志文件
- 读取每个日志文件,提取 ERROR、Exception 等级别的内容
- 按时间排序,汇总错误信息
- 生成 Markdown 报告到
~/logs-analysis.md - 返回摘要:总错误数、主要错误类型、最频繁的错误
指定文件分析
用户输入:分析 ~/logs/app.log 和 ~/logs/error.log 中的报错
流程:
- 只读取指定的日志文件
- 提取错误内容和上下文(前后 2-3 行)
- 生成报告并保存到
~/logs/app-analysis.md
时间范围过滤
用户输入:分析今天(2026-07-13)的日志错误
流程:
- 扫描日志文件,过滤出指定日期的日志
- 提取当天的错误和异常
- 按时间段统计错误分布
- 生成带时间轴的报告
模式匹配分析
用户输入:查找 ~/logs 下所有包含「connection timeout」的日志
流程:
- 在所有日志文件中搜索指定模式
- 提取匹配行的上下文
- 统计出现次数和位置
- 生成专门的分析报告
报告格式
生成的 Markdown 报告包含以下部分:
# 日志分析报告
生成时间:2026-07-13 15:32:00
扫描目录:~/logs
日志文件数:X 个
## 📊 总体统计
| 指标 | 数量 |
|------|------|
| 总错误数 | 123 |
| FATAL 级别 | 2 |
| ERROR 级别 | 98 |
| WARN 级别 | 23 |
| 异常数量 | 45 |
## 🔴 高优先级错误(P0-P1)
### 错误 1:数据库连接失败
- 时间:2026-07-13 10:23:45
- 文件:app.log:1234
- 内容:ERROR: Database connection timeout after 30s
- 频率:出现 15 次
### 错误 2:...
## 📈 错误分布
按时间段:
- 08:00-12:00:45 错误
- 12:00-18:00:78 错误
- 18:00-24:00:0 错误
按文件:
- app.log:98 错误
- error.log:25 错误
## 🔄 重复错误模式
1. 「Connection timeout」 - 15 次
2. 「NullPointerException」 - 8 次
3. 「Failed to parse」 - 5 次
## 📝 详细错误列表
[完整错误列表...]
常见问题
-
问:支持哪些日志格式? 答:支持纯文本日志、JSON 日志、常见框架日志格式(如 Nginx、Apache、应用日志)。
-
问:日志文件很大怎么办? 答:大文件会分段读取,提取关键部分。建议先过滤时间范围。
-
问:可以自定义错误关键词吗? 答:可以,支持在命令中指定额外的关键词或正则表达式。
-
问:报告保存到哪里? 答:默认保存到
~/logs-analysis.md,可指定其他路径。 -
问:如何处理编码问题? 答:自动检测常见编码(UTF-8、GBK 等),如遇问题可手动指定。
与相关技能的关系
grep/find:底层使用这些工具进行文件搜索tmux:如需实时监控日志,可结合 tmux 执行 tail -fbrief:生成快速摘要时相关python-debugpy:如日志来自 Python 调试,可结合使用
更新日志
- v1.0.0 — 初始版本,支持自动扫描、错误识别、Markdown 报告生成
反馈
如有问题或建议,请反馈给技能创建者。
Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决用户日常运维中的高频刚需任务,如快速定位日志错误、分析异常趋势
- 提供自动化日志扫描、错误识别、模式匹配和 Markdown 报告生成等完整功能闭环
Highlights
- 触发词覆盖「日志分析」「log analysis」「日志报错」「分析日志」等常见表达,边界清晰
- 支持多种变体输入,能准确匹配用户意图
Areas to improve
-
description写错位置 Reported severity: Minor
顶层 frontmatter 中 description 字段为空,实际描述内容位于 skill_body 内部
Recommendation: 建议将 description 内容移至顶层 frontmatter 的 description 字段中,以符合规范
Highlights
- 文档结构完整,包含使用场景、核心功能、使用示例、报告格式等
- 步骤清晰,有端到端示例,frontmatter 完整,单文件未超限
Highlights
- 工具来源明确(基于 grep/find 等标准工具),参数合理
- 覆盖常见异常(如大文件处理、编码检测),不可逆操作有明确输出路径
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.