Bundle
dsh-log-analyzer
日志分析:解析日志文件,提取错误/异常/告警,按签名聚合统计并返回结构化错误清单与上下文
- Source
- uckkk
- stars
- 1 stars
- License
- MIT
- Updated
- Updated 2 days ago
Readme
# dsh-log-analyzer · 日志分析 解析日志文件,提取错误/异常/告警,按「归一化签名」聚合统计(自动去掉时间戳、数字、路径等噪声),返回结构化错误清单与上下文。纯 Node 实现,无网络、无外部服务。 ## 提供的工具 | 工具 | 作用 | |---|---| | `analyze_log` | 统计错误/告警,按签名聚合错误类型分布 + 错误行清单 | | `extract_errors` | 按正则提取错误行及其上下文(前后 N 行) | ## 安装 ```bash dsh plugin add dsh-log-analyzer ``` 安装后在 profile 的 `package.json` 的 `dsh.profile.bundles` 中加入 `"dsh-log-analyzer"`。 ## 用法示例 ``` 帮我分析这个日志里有哪些错误 → 调用 analyze_log(file="app.log") 找出所有 Timeout 错误及上下文 → 调用 extract_errors(file="app.log", pattern="Timeout|Connection refused", context=3) ``` ## 说明 - 识别 `ERROR/FATAL/Exception/Traceback/panic/failed` 等常见错误关键词。 - 超长日志只读尾部(默认 5 万行),可通过 `maxLines` 调整。 ## 安装 ```bash dsh plugin add github:uckkk/dsh-log-analyzer ``` > 安装即在本机运行第三方代码,请自行审阅源码。 ## 安装 ```bash dsh plugin add github:uckkk/dsh-log-analyzer ``` ## 使用 安装后在会话中调用该插件注册的工具即可。 ## 许可 MIT > 安装即在本机运行第三方代码,请自行审阅源码。
Install
dsh plugin --profile web add github:uckkk/dsh-log-analyzer#571c49484afc18203a68c7d4f3b5d5d4f3b0606f
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-log-analyzer from the hub