log-analyzer
Skill1 starsChanged 4 months agoMITView on GitHub
Use when a user wants to find errors in a log file, understand what happened in a service from its logs, count error types, find time-based error spikes, or says "check the logs" / "what went wrong".
4 other projects use a version of this.
Adopted by
Most recently taken up by
- zrt-ai-lab/opencode-skillstheir own version, first seen Jul 13, 2026
- laolaoshiren/claude-code-skills-zhtheir own version, first seen Jul 2, 2026
- inbharatai/claude-skillstheir own version, first seen Mar 14, 2026
- skyvanguard/infra-opstheir own version, first seen Jan 23, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- laolaoshiren/claude-code-skills-zh★ 876same name
- zrt-ai-lab/opencode-skills★ 287same name
- inbharatai/claude-skills★ 37same name
- skyvanguard/infra-ops★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository58 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- api-test-suiteSkill
- ascii-artSkill
- caddy-reverse-proxySkill
- changelog-generatorSkill
- color-palette-generatorSkill
- cron-taskSkill
- csv-toolkitSkill
- discord-bot-buildSkill
- docker-umbrellaSkill
- dotfiles-manageSkill
- email-sendSkill
- env-config-managerSkill
- excalidraw-diagramSkill
- file-organizerSkill
- forgejo-self-hostSkill
- frontend-design-toolkitSkill
- generate-dockerfileSkill
- gif-searchSkill
- git-backupSkill
- github-actions-ciSkill
- hallmark-readmeSkill
- http-api-testerSkill
- invoice-generatorSkill
- json-formatterSkill
- markdown-linterSkill
- markdown-to-pdfSkill
- markdown-to-slidesSkill
- mcp-server-buildSkill
- media-id-mappingSkill
- movie-catalogue-siteSkill
- movie-night-calendarSkill
- ntfy-notifierSkill
- ocr-documentsSkill
- ollama-localSkill
- openapi-generatorSkill
- password-generatorSkill
- pdf-extractSkill
- portfolio-upkeepSkill
- qr-code-generatorSkill
- regex-testerSkill
- resume-builderSkill
- rss-monitorSkill
- searxng-self-hostSkill
- skill-publishSkill
- skill-registry-catalogSkill
- skills-portfolio-scaffoldSkill
- snippet-managerSkill
- sqlite-dashboardSkill
- streaming-provider-embedsSkill
- tailscale-deploySkill
- telegram-bot-buildSkill
- tmdb-metadataSkill
- uptime-kuma-self-hostSkill
- watchlist-syncSkill
- webhook-receiverSkill
- youtube-transcriptSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 183
Run log_summary for a quick overview
- Very specific: line 184
Run count_error_types to categorize errors
- Very specific: line 185
Run errors_by_hour to find time-based spikes
- Very specific: line 194
Rotated logs: If logs rotate (app.log.1, app.log.2), analyze all of them.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
log-analyzer
Overview
Parse and analyze log files to find errors, warnings, patterns, and anomalies. The agent handles large log files, extracts structured data, counts error types, finds time-based patterns, and summarizes findings.
When to Use
- The user wants to find errors in a log file.
- The user wants to understand what happened in a service from its logs.
- The user wants to count error types or find the most common issues.
- The user says "check the logs", "find errors in this log", or "what went wrong".
Basic Error Extraction
import re
from collections import Counter
def find_errors(log_path: str, patterns: list = None) -> dict:
"""Find error and warning lines in a log file."""
if patterns is None:
patterns = [
r'\bERROR\b',
r'\bFATAL\b',
r'\bCRITICAL\b',
r'\bException\b',
r'\bTraceback\b',
r'\bpanic\b',
]
errors = []
with open(log_path, 'r', errors='ignore') as f:
for line_num, line in enumerate(f, 1):
for pattern in patterns:
if re.search(pattern, line, re.IGNORECASE):
errors.append({"line": line_num, "text": line.strip(), "pattern": pattern})
break
return {
"total_errors": len(errors),
"first_10": errors[:10],
"last_10": errors[-10:],
}Error Type Counting
def count_error_types(log_path: str) -> dict:
"""Categorize and count errors by type."""
error_patterns = {
"connection_refused": r"Connection.*refused|ECONNREFUSED",
"timeout": r"timeout|timed out|ETIMEDOUT",
"not_found": r"not found|404|ENOENT",
"permission_denied": r"permission denied|EACCES|403",
"out_of_memory": r"out of memory|ENOMEM|OOM",
"auth_failure": r"auth.*fail|unauthorized|401",
"rate_limit": r"rate limit|429|throttl",
"ssl_error": r"SSL|certificate|TLS",
}
counts = Counter()
with open(log_path, 'r', errors='ignore') as f:
for line in f:
for error_type, pattern in error_patterns.items():
if re.search(pattern, line, re.IGNORECASE):
counts[error_type] += 1
return dict(counts.most_common())Time-based Analysis
from datetime import datetime
from collections import defaultdict
def errors_by_hour(log_path: str, timestamp_pattern: str = r'\[(\d{4}-\d{2}-\d{2}T\d{2}):\d{2}:\d{2}'):
"""Count errors per hour to find spikes."""
hourly = defaultdict(int)
with open(log_path, 'r', errors='ignore') as f:
for line in f:
if re.search(r'ERROR|FATAL|Exception', line, re.IGNORECASE):
match = re.search(timestamp_pattern, line)
if match:
hourly[match.group(1)] += 1
return dict(sorted(hourly.items()))Extract Stack Traces
def extract_tracebacks(log_path: str) -> list:
"""Extract full stack traces from a log file."""
tracebacks = []
current_trace = []
in_trace = False
with open(log_path, 'r', errors='ignore') as f:
for line in f:
if 'Traceback' in line or 'panic:' in line:
if current_trace:
tracebacks.append('\n'.join(current_trace))
current_trace = [line]
in_trace = True
elif in_trace:
if line.strip() == '' or (not line.startswith(' ') and not line.startswith('\t') and not line.startswith('File') and not line.startswith(' ')):
tracebacks.append('\n'.join(current_trace))
current_trace = []
in_trace = False
else:
current_trace.append(line)
if current_trace:
tracebacks.append('\n'.join(current_trace))
return tracebacksTail with Filtering
def tail_filter(log_path: str, keyword: str, lines: int = 50):
"""Get the last N lines matching a keyword."""
matching = []
with open(log_path, 'r', errors='ignore') as f:
for line in f:
if keyword.lower() in line.lower():
matching.append(line.strip())
if len(matching) > lines:
matching.pop(0)
return matchingSummary Report
def log_summary(log_path: str) -> dict:
"""Generate a comprehensive log summary."""
total_lines = 0
error_count = 0
warn_count = 0
info_count = 0
with open(log_path, 'r', errors='ignore') as f:
for line in f:
total_lines += 1
if re.search(r'\bERROR\b|\bFATAL\b', line, re.IGNORECASE):
error_count += 1
elif re.search(r'\bWARN', line, re.IGNORECASE):
warn_count += 1
elif re.search(r'\bINFO\b', line, re.IGNORECASE):
info_count += 1
return {
"file": log_path,
"total_lines": total_lines,
"errors": error_count,
"warnings": warn_count,
"info": info_count,
"error_rate": f"{error_count / total_lines * 100:.2f}%" if total_lines > 0 else "0%",
"error_types": count_error_types(log_path),
}Workflow
- Identify the log file(s) to analyze
- Run
log_summaryfor a quick overview - Run
count_error_typesto categorize errors - Run
errors_by_hourto find time-based spikes - Extract specific tracebacks or filtered lines for detail
- Report findings: what errors, how many, when, and what types
Common Pitfalls
- Large log files. Reading a 10GB log file line by line into memory will crash. Use the line-by-line iterators (as shown above) — they're memory-efficient. For extremely large files, use
grepfirst to pre-filter. - Timestamp format varies. The default regex assumes ISO 8601. Adjust the pattern for your log format (e.g.,
r'(\d{2}:\d{2}):\d{2}'forHH:MM:SS). - Multi-line stack traces. Error lines span multiple lines. The traceback extractor handles this, but simple line-by-line error counting may miss context.
- Rotated logs. If logs rotate (
app.log.1,app.log.2), analyze all of them. Useglob.glob("app.log*")to find all rotation files. - Encoding. Some logs use non-UTF-8 encoding. Use
errors='ignore'to skip bad bytes, or detect encoding withchardet. - False positives. The word "error" can appear in non-error contexts (e.g., "error handling module"). Refine patterns to match your log format.
Verification Checklist
log_summary's error/warning/info counts are consistent withtotal_lines- All log rotation files (
app.log.1,app.log.2, ...) were included, not just the current file - The timestamp regex was checked against the actual log's format before trusting
errors_by_houroutput - A sample of flagged "error" lines was reviewed for false positives (e.g. "error handling module")
- Encoding errors were handled (
errors='ignore'or detected) rather than the analysis crashing mid-file
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

