원클릭으로
log-analysis
日志分析助手。journalctl 用法、常见日志路径、grep/awk 过滤、tail -f 模式、日志轮转。分析系统或应用日志时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
日志分析助手。journalctl 用法、常见日志路径、grep/awk 过滤、tail -f 模式、日志轮转。分析系统或应用日志时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
生成或审计模块的 SPEC.md。使用场景:用户要求"给 XX 模块写 spec"、"审计所有 spec"、"检查 spec 是否过期"。
Automates SailFish release workflow: fix build/type errors, update CHANGELOG (EN + CN), run npm version with pre/post hooks. Use when the user asks to release, 发版, 发布, bump version, or update changelog.
后端代码修改后,通过 CLI 测试验证功能正确性。使用场景:修改了 electron/services/ 下的代码需要测试、准备提交代码前跑回归、用户要求"跑测试"/"验证一下"。
完成新功能开发或较大修改后,使用本机 Claude CLI 进行代码审查。
使用 ts-morph 静态分析工具查询代码结构(类层次、方法签名、引用、依赖等),替代手动读源码。使用场景:需要了解类的方法/属性、继承链、符号引用、文件结构、依赖关系时。
When committing or staging changes, only include files related to the current task or conversation; do not stage or commit unrelated modifications. Use when the user asks to commit, stage, 提交, or when preparing to run git add/commit.
| name | log-analysis |
| description | 日志分析助手。journalctl 用法、常见日志路径、grep/awk 过滤、tail -f 模式、日志轮转。分析系统或应用日志时使用。 |
| version | 1.0.0 |
journalctl -u nginx -f # 实时查看 nginx 日志
journalctl -u nginx --since "1 hour ago" # 最近 1 小时
journalctl -u nginx --since "2024-01-15" --until "2024-01-16"
journalctl -p err -b # 本次启动的错误日志
journalctl -o short-precise # 精确时间戳
journalctl -n 100 -u docker # 最近 100 行
持久化:确保 /etc/systemd/journald.conf 中 Storage=persistent。
| 类型 | 路径 |
|---|---|
| 系统 | /var/log/syslog、/var/log/messages |
| 认证 | /var/log/auth.log |
| Nginx | /var/log/nginx/access.log、error.log |
| Apache | /var/log/apache2/access.log、error.log |
| MySQL | /var/log/mysql/error.log |
# 错误行
grep -i error /var/log/syslog
# 时间段(syslog 格式)
grep "Jan 15 14:" /var/log/syslog
# awk 按列过滤(Nginx access.log)
awk '$9 == 500' /var/log/nginx/access.log
awk '$7 ~ /\.php/' /var/log/nginx/access.log
tail -f /var/log/nginx/access.log
tail -f /var/log/syslog | grep --line-buffered ERROR
配置:/etc/logrotate.d/ 下各应用配置。
手动执行:sudo logrotate -f /etc/logrotate.conf
检查配置:logrotate -d /etc/logrotate.d/nginx