log-analysis

log-analysis is a skill for Claude Code, Codex from chaterm/terminal-skills. It costs 7 tokens per session (1,941 once invoked), scanned A, original, Apache-2.0.

A guide to reading and searching system and application logs. Logs are text records that describe what software and servers are doing.

In plain words
What is it for?
Use it to follow live logs, inspect recent entries, filter by time, search for words or patterns, show nearby lines, and count matches.
Why use it?
It helps narrow down errors and events in large or continuously changing log files.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to follow live logs, inspect recent entries, filter by time, search for words or patterns, show nearby lines, and count matches.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chaterm/terminal-skills/log-analysis
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chaterm/terminal-skills --skill log-analysis
Clone the repo
git clone --depth 1 https://github.com/chaterm/terminal-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for log-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/chaterm/terminal-skills/log-analysis/github.svg)](https://agentmods.dev/skills/chaterm/terminal-skills/log-analysis)
Your own site
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/log-analysis"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/log-analysis/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for log-analysis

Your own site · 80×15
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/log-analysis"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/log-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,941 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00007 $0.01941
Opus 5 $0.00003 $0.00971
Sonnet 5 $0.00001 $0.00388
Haiku 4.5 $0.00001 $0.00194

Measured 9d ago against content hash 9115c6bacaa9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

log-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

server/log-analysis/SKILL.md · 251 lines

How it starts

The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.

日志分析与处理

概述

日志聚合、分析工具、告警配置等技能。

日志查看

基础命令

# 实时查看
tail -f /var/log/syslog
tail -f /var/log/nginx/access.log

# 多文件同时查看
tail -f /var/log/nginx/*.log
multitail /var/log/nginx/access.log /var/log/nginx/error.log

# 查看最后N行
tail -n 100 /var/log/syslog

# 查看开头
head -n 100 /var/log/syslog

# 分页查看
less /var/log/syslog
less +F /var/log/syslog             # 类似 tail -f

按时间过滤

# 使用 sed 按时间范围
sed -n '/2024-01-15 10:00/,/2024-01-15 11:00/p' /var/log/app.log

# 使用 awk
awk '/2024-01-15 10:/ && /2024-01-15 11:/' /var/log/app.log

# 使用 journalctl
journalctl --since "2024-01-15 10:00" --until "2024-01-15 11:00"
journalctl --since "1 hour ago"
journalctl --since today

文本搜索

grep

# 基础搜索
grep "error" /var/log/syslog
grep -i "error" /var/log/syslog     # 忽略大小写
grep -r "error" /var/log/           # 递归搜索

# 正则表达式
grep -E "error|warning" /var/log/syslog
grep -P "\d{4}-\d{2}-\d{2}" /var/log/syslog  # Perl 正则

# 上下文
grep -A 3 "error" /var/log/syslog   # 后3行
grep -B 3 "error" /var/log/syslog   # 前3行
grep -C 3 "error" /var/log/syslog   # 前后3行

# 统计
grep -c "error" /var/log/syslog     # 计数
grep -l "error" /var/log/*.log      # 只显示文件名

# 排除
grep -v "debug" /var/log/syslog     # 排除包含 debug 的行

ripgrep (rg)

# 更快的搜索
rg "error" /var/log/
rg -i "error" /var/log/             # 忽略大小写
rg -C 3 "error" /var/log/           # 上下文
rg --type log "error"               # 按文件类型

文本处理

awk

# 打印特定列
awk '{print $1, $4}' /var/log/nginx/access.log

# 条件过滤
awk '$9 == 500' /var/log/nginx/access.log
awk '$9 >= 400 && $9 < 500' /var/log/nginx/access.log

# 统计
awk '{sum += $10} END {print sum}' /var/log/nginx/access.log
awk '{count[$9]++} END {for (c in count) print c, count[c]}' /var/log/nginx/access.log

# 自定义分隔符
awk -F: '{print $1}' /etc/passwd
awk -F'[ :]' '{print $1, $2}' /var/log/syslog

sed

# 替换
sed 's/old/new/g' file.log
sed -i 's/old/new/g' file.log       # 原地修改

# 删除行
sed '/pattern/d' file.log
sed '1,10d' file.log                # 删除前10行

# 提取行
sed -n '10,20p' file.log            # 打印10-20行
sed -n '/start/,/end/p' file.log    # 打印匹配范围

Read the full file on GitHub · 251 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 251 lines · 7 tokens per session scan A 9115c6bacaa9

Subscribe to this mod's changes

log-analysis is a skill published in the GitHub repository chaterm/terminal-skills (58 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 7 tokens to every session and 1,941 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

log-diagnostic

A log-analysis tool that detects JSON, syslog, and Nginx formats and reports grouped errors, occurrence counts, severity levels, and time distribution. It can filter entries by level or time range and export JSON.

serejaris/kimi-skills · 88 tokens

performance-analysis

Performance analysis, bottleneck detection, and optimization recommendations. Use when profiling slow code or systems, hunting a performance regression, or producing an optimization plan with measurable targets.

frankxai/claude-skills-library · 36 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

serejaris/kimi-skills · 71 tokens

langsmith-observability

LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.

davila7/claude-code-templates · 45 tokens

phoenix-observability

Open-source AI observability platform for LLM tracing, evaluation, and monitoring. Use when debugging LLM applications with detailed traces, running evaluations on datasets, or monitoring production AI systems with real-time insights.

davila7/claude-code-templates · 47 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens