AgentSkillsCN

Log Parser CLI

将智能体的持久学习成果以JSON条目形式记录,以便在各项任务中重复使用。

SKILL.md
--- frontmatter
name: Log Parser CLI
description: Parse and analyze log files. Apache, Nginx, JSON logs. Filter, aggregate, and extract patterns. Free log analysis tool.
tags: [logs, parser, analysis, nginx, apache, cli, devops, monitoring]

Log Parser CLI

Parse logs like a pro. Apache, Nginx, JSON, custom formats.

Filter. Aggregate. Analyze. Export.

Quick Start

bash
npm install -g @lxgicstudios/logparse
bash
# Parse Nginx access log
logparse nginx /var/log/nginx/access.log

# Filter errors
logparse parse app.log --level error

# Top IPs
logparse nginx access.log --top-ips 10

Supported Formats

FormatAuto-detected
Nginx access
Apache access
Apache error
JSON lines
Syslog
Custom (regex)Manual

Commands

bash
# Parse with auto-detection
logparse parse app.log

# Filter by time range
logparse parse app.log --after "2024-01-01" --before "2024-01-31"

# Filter by status code
logparse nginx access.log --status 5xx

# Aggregate by endpoint
logparse nginx access.log --group path --count

# Top slowest requests
logparse nginx access.log --sort response_time --desc -n 20

# Extract IPs making errors
logparse nginx access.log --status 5xx --extract ip

# Custom regex pattern
logparse parse app.log --pattern "(?<timestamp>\d{4}-\d{2}-\d{2}) (?<level>\w+) (?<message>.*)"

# Export to JSON
logparse nginx access.log -o analysis.json

Analysis Features

bash
# Request rate over time
logparse nginx access.log --rate 1h

# Status code distribution
logparse nginx access.log --stats status

# Bandwidth usage
logparse nginx access.log --bandwidth

When to Use This

  • Debugging production issues
  • Security analysis
  • Performance monitoring
  • Usage analytics
  • Incident investigation

Built by LXGIC Studios

🔗 GitHub · Twitter