
Log Analyzer
- 21 installs
- 84 repo stars
- Updated January 28, 2026
- aidotnet/moyucode
log-analyzer is a Claude Code skill that parses and analyzes log files to extract patterns, filter entries, generate statistics, and detect errors.
About
log-analyzer is a Claude Code skill that parses and analyzes log files using a bundled Python script based on logparser. A developer uses it to filter by log level, search for patterns, generate statistics, and detect errors, plus a tail mode. It is useful for triaging application logs and finding failures.
- Filters log entries by level (e.g. ERROR)
- Searches log patterns with grep-style matching
- Generates statistics and tails the last N lines
Log Analyzer by the numbers
- 21 all-time installs (skills.sh)
- Ranked #393 of 596 Debugging skills by installs in the Skillselion catalog
- Data as of Jul 28, 2026 (Skillselion catalog sync)
log-analyzer capabilities & compatibility
- Capabilities
- log parsing · error detection · pattern search
- Use cases
- debugging · data analysis
- Pricing
- Free
What log-analyzer says it does
Parse and analyze log files to extract patterns, filter entries, generate statistics, and detect errors.
python scripts/log_analyzer.py app.log --level ERROR
npx skills add https://github.com/aidotnet/moyucode --skill log-analyzerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 21 |
|---|---|
| repo stars | ★ 84 |
| Last updated | January 28, 2026 |
| Repository | aidotnet/moyucode ↗ |
What it does
Parse a log file to filter by level, search patterns, and detect errors.
When should I use this skill?
A developer needs to analyze logs or find errors in logs.
What you get
The developer gets filtered, searched, and summarized log output with errors surfaced.
By the numbers
- 5 modes: analyze, filter by level, grep pattern, stats, tail
Files
Log Analyzer Tool
Description
Parse and analyze log files to extract patterns, filter entries, generate statistics, and detect errors.
Trigger
/logscommand- User needs to analyze logs
- User wants to find errors in logs
Usage
# Analyze log file
python scripts/log_analyzer.py app.log
# Filter by level
python scripts/log_analyzer.py app.log --level ERROR
# Search pattern
python scripts/log_analyzer.py app.log --grep "connection failed"
# Get statistics
python scripts/log_analyzer.py app.log --stats
# Tail mode
python scripts/log_analyzer.py app.log --tail 100Tags
logs, analysis, debugging, monitoring, errors
Compatibility
- Codex: ✅
- Claude Code: ✅
#!/usr/bin/env python3
"""
Log Analyzer Tool - Parse and analyze log files.
Based on: https://github.com/logpai/logparser
Usage:
python log_analyzer.py app.log
python log_analyzer.py app.log --level ERROR
python log_analyzer.py app.log --grep "connection"
"""
import argparse
import re
import sys
from collections import Counter
from pathlib import Path
LOG_LEVELS = ['DEBUG', 'INFO', 'WARN', 'WARNING', 'ERROR', 'FATAL', 'CRITICAL']
def parse_log_line(line):
"""Parse a log line and extract components."""
# Pattern: timestamp [LEVEL] message
pattern = r'^(\d{4}-\d{2}-\d{2}[\sT]\d{2}:\d{2}:\d{2}[.,]?\d*)\s*\[?(\w+)\]?\s*(.*)$'
match = re.match(pattern, line)
if match:
return {'timestamp': match.group(1), 'level': match.group(2).upper(), 'message': match.group(3)}
# Simple pattern: [LEVEL] message
pattern2 = r'^\[?(\w+)\]?\s*[:-]?\s*(.*)$'
match2 = re.match(pattern2, line)
if match2 and match2.group(1).upper() in LOG_LEVELS:
return {'timestamp': '', 'level': match2.group(1).upper(), 'message': match2.group(2)}
return {'timestamp': '', 'level': 'INFO', 'message': line}
def analyze_logs(filepath, level=None, grep=None, stats=False, tail=None):
"""Analyze log file."""
path = Path(filepath)
if not path.exists():
print(f"Error: File not found: {filepath}", file=sys.stderr)
sys.exit(1)
with open(path, 'r', encoding='utf-8', errors='ignore') as f:
lines = f.readlines()
if tail:
lines = lines[-tail:]
entries = [parse_log_line(line.strip()) for line in lines if line.strip()]
# Filter by level
if level:
level_upper = level.upper()
entries = [e for e in entries if e['level'] == level_upper]
# Filter by grep pattern
if grep:
entries = [e for e in entries if grep.lower() in e['message'].lower()]
if stats:
level_counts = Counter(e['level'] for e in entries)
print(f"Total entries: {len(entries)}")
print("\nBy level:")
for lvl in LOG_LEVELS:
if lvl in level_counts:
print(f" {lvl}: {level_counts[lvl]}")
return
for entry in entries:
lvl = entry['level']
color = '\033[91m' if lvl in ['ERROR', 'FATAL', 'CRITICAL'] else ''
reset = '\033[0m' if color else ''
ts = f"[{entry['timestamp']}] " if entry['timestamp'] else ''
print(f"{color}{ts}[{lvl}] {entry['message']}{reset}")
def main():
parser = argparse.ArgumentParser(description="Analyze log files")
parser.add_argument('file', help='Log file to analyze')
parser.add_argument('--level', '-l', help='Filter by log level')
parser.add_argument('--grep', '-g', help='Search pattern')
parser.add_argument('--stats', '-s', action='store_true', help='Show statistics')
parser.add_argument('--tail', '-t', type=int, help='Show last N lines')
args = parser.parse_args()
analyze_logs(args.file, args.level, args.grep, args.stats, args.tail)
if __name__ == "__main__":
main()