一键导入
log-analyzer
全维度日志分析技能。自动识别日志类型(Java应用/MySQL Binlog/Nginx/Trace/告警),提取关键实体(IP、thread_id、trace_id、用户、表名等),进行根因定位、告警分析、异常洞察。支持100M+大文件。触发词:分析日志、日志排查、根因定位、告警分析、异常分析。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
全维度日志分析技能。自动识别日志类型(Java应用/MySQL Binlog/Nginx/Trace/告警),提取关键实体(IP、thread_id、trace_id、用户、表名等),进行根因定位、告警分析、异常洞察。支持100M+大文件。触发词:分析日志、日志排查、根因定位、告警分析、异常分析。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when a request asks for a Chinese-first AI video script with shot plans, image prompts, narration, subtitles, or handoff contracts for scene generation, image generation, video assembly, or WeChat draft preparation.
Use when a Codex task needs native image generation or editing, especially a set, series, material kit, long image, multi-screen design, storyboard, carousel, or other deliverable requiring multiple consistent images.
Skill 开发指南。当用户需要创建新 Skill 或更新已有 Skill 时触发,提供标准化模板、目录规范和最佳实践。
Use when reviewing an agent Skill before sharing, installing, or executing it and when checking a Skill bundle for credentials, dangerous commands, suspicious network behavior, or obfuscated code.
This skill should be used when preparing Markdown articles for a WeChat Official Account draft box, selecting wenyan-cli themes, processing article images, or troubleshooting authentication and whitelist failures.
Fetch and summarize Feishu group chat history. Use when the user asks to read, review, or summarize messages from a Feishu group chat. Triggers: "看群聊记录", "群里聊了啥", "帮我看看这个群", "群消息历史", "chat history", "what did the group discuss". NOT for: sending messages (use message tool), reading documents (use feishu-doc skill), or wiki operations (use feishu-wiki skill).
| name | log-analyzer |
| description | 全维度日志分析技能。自动识别日志类型(Java应用/MySQL Binlog/Nginx/Trace/告警),提取关键实体(IP、thread_id、trace_id、用户、表名等),进行根因定位、告警分析、异常洞察。支持100M+大文件。触发词:分析日志、日志排查、根因定位、告警分析、异常分析。 |
基于 RAPHL(Recursive Analysis Pattern for Hierarchical Logs)的全维度智能日志分析技能。流式处理,内存占用低,100M+ 日志秒级分析。
| 能力 | 说明 |
|---|---|
| 自动识别 | 自动识别日志类型:Java App / MySQL Binlog / Nginx / Trace / Alert |
| 实体提取 | IP、thread_id、trace_id、user_id、session_id、bucket、URL、表名等 20+ 种 |
| 操作分析 | DELETE/UPDATE/INSERT/DROP 等敏感操作检测 |
| 关联分析 | 时间线、因果链、操作链构建 |
| 智能洞察 | 自动生成分析结论、证据、建议 |
| 类型 | 识别特征 | 提取内容 |
|---|---|---|
| Java App | ERROR/WARN + 堆栈 | 异常类型、堆栈、logger、时间 |
| MySQL Binlog | server id、GTID、Table_map | 表操作、thread_id、server_id、数据变更 |
| Nginx Access | IP + HTTP 方法 + 状态码 | 请求IP、URL、状态码、耗时 |
| Trace | trace_id、span_id | 链路追踪、调用关系、耗时 |
| Alert | CRITICAL/告警 | 告警级别、来源、消息 |
| General | 通用 | 时间、IP、关键词 |
python .opencode/skills/log-analyzer/scripts/preprocess.py <日志文件> -o ./log_analysis
| 文件 | 内容 | 用途 |
|---|---|---|
summary.md | 完整分析报告 | 优先阅读 |
entities.md | 实体详情(IP、用户、表名等) | 追溯操作来源 |
operations.md | 操作详情 | 查看具体操作 |
insights.md | 智能洞察 | 问题定位和建议 |
analysis.json | 结构化数据 | 程序处理 |
| 类型 | 检测模式 | 风险级别 |
|---|---|---|
| 数据删除 | DELETE, DROP, TRUNCATE | HIGH |
| 数据修改 | UPDATE, ALTER, MODIFY | MEDIUM |
| 权限变更 | GRANT, REVOKE, chmod | HIGH |
| 认证操作 | LOGIN, LOGOUT, AUTH | MEDIUM |
| 类型 | 说明 |
|---|---|
| security | 大批量删除/修改、权限变更 |
| anomaly | 高频 IP、异常时间段操作 |
| error | 严重异常、错误聚类 |
| audit | 操作来源、用户行为 |
Phase 1: 日志类型识别(采样前100行)
↓
Phase 2: 全量扫描提取(流式处理)
↓
Phase 3: 关联分析(时间排序、聚合统计)
↓
Phase 4: 智能洞察(异常检测、生成结论)
↓
Phase 5: 生成报告(Markdown + JSON)
| 特点 | 说明 |
|---|---|
| 流式处理 | 逐行读取,100M 文件只占几 MB 内存 |
| 正则预编译 | 20+ 种实体模式预编译,匹配快 |
| 一次遍历 | 提取 + 统计 + 分类一次完成 |
| 类型适配 | 不同日志类型用专用解析器 |