← 返回 Skills 市场
freeter226

Log Parser

作者 freeter226 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
187
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install log-parser
功能描述
Parse and analyze various log formats (nginx, apache, syslog, application logs). Extract key information and generate reports.
使用说明 (SKILL.md)

Log Parser

A log parsing and analysis tool for security operations and DevOps.

Features

  • Multi-format Support - nginx, apache, syslog, application logs
  • Auto-detection - Automatically detect log format
  • Key Extraction - Extract IPs, timestamps, error codes, URLs
  • Filtering - Filter logs by IP, status code, time range
  • Statistics - Generate summary reports
  • Error Detection - Identify and highlight error entries

Usage

python3 skills/log-parser/scripts/log_parser.py \x3Caction> [options]

Actions

Action Description
parse Parse log file and extract fields
stats Generate statistics report
filter Filter logs by criteria
errors Extract error entries only
top Top N items (IPs, URLs, etc.)

Options

Option Type Default Description
--file string - Log file path
--format string auto Log format (auto, nginx, apache, syslog)
--limit int 100 Max results to return
--filter-ip string - Filter by IP address
--filter-status string - Filter by status code
--top-field string - Field for top N (ip, url, status)

Supported Log Formats

nginx

192.168.1.1 - - [22/Mar/2026:14:00:00 +0800] "GET /api/test HTTP/1.1" 200 1234

apache

192.168.1.1 - - [22/Mar/2026:14:00:00 +0800] "GET /api/test HTTP/1.1" 200 1234

syslog

Mar 22 14:00:00 server sshd[12345]: Failed password for root from 192.168.1.1

application logs (JSON)

{"timestamp": "2026-03-22T14:00:00Z", "level": "ERROR", "message": "..."}

Examples

# Parse log file
python3 skills/log-parser/scripts/log_parser.py parse --file /var/log/nginx/access.log

# Generate statistics
python3 skills/log-parser/scripts/log_parser.py stats --file /var/log/nginx/access.log

# Filter by IP
python3 skills/log-parser/scripts/log_parser.py filter --file /var/log/nginx/access.log --filter-ip 192.168.1.1

# Get top 10 IPs
python3 skills/log-parser/scripts/log_parser.py top --file /var/log/nginx/access.log --top-field ip --limit 10

# Extract errors
python3 skills/log-parser/scripts/log_parser.py errors --file /var/log/nginx/access.log

Use Cases

  1. Security Analysis - Identify suspicious IPs, failed logins
  2. Performance Monitoring - Find slow requests, errors
  3. Traffic Analysis - Top URLs, user agents
  4. Debugging - Extract error entries quickly

Output Format

All results are returned in JSON format:

{
  "success": true,
  "total": 1000,
  "parsed": 998,
  "entries": [...],
  "stats": {...}
}

Current Status

In development.

安全使用建议
This skill appears to be what it claims: a local log parser implemented in a single Python script. Before running it, review the script (you already have the source) and only point it at log files you are willing to share with the script — logs may contain sensitive data (credentials, IPs, tokens). Because there is no install step, the main risk is executing untrusted code locally; if you don't trust the source, run it in a sandbox/container or inspect/modify the script yourself. Note the small path inconsistency in SKILL.md (invocation path) — use the script path present in the package (scripts/log_parser.py) when running.
能力评估
Purpose & Capability
Name/description (log parsing, nginx/apache/syslog/JSON) matches the provided code and SKILL.md. The only declared binary (python3) is appropriate for running the included Python script. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md instructs running the provided script against local log files (e.g., /var/log/nginx/access.log), which is expected for a log parser. The instructions and code only read files supplied by the user and parse their contents. Note: SKILL.md uses an invocation path 'skills/log-parser/scripts/log_parser.py' while the package contains 'scripts/log_parser.py' (README uses the latter) — minor path inconsistency but not a security issue. Also note that parsing local logs implies access to potentially sensitive data; this is expected but worth considering before running.
Install Mechanism
No install spec is provided (instruction-only with one script file). Nothing is downloaded or installed automatically; risk is limited to executing the included Python script locally.
Credentials
No environment variables, credentials, or config paths are requested. The script does not read environment variables or other credentials; it only opens the file path given by the user. This is proportionate to the stated purpose.
Persistence & Privilege
The skill is not always-enabled and does not request elevated or persistent privileges, nor does it modify other skills or system configuration. Autonomous invocation is allowed (platform default) but the skill itself does not perform background or persistent actions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install log-parser
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /log-parser 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
首个版本:支持 nginx/apache/syslog/JSON 格式解析、统计、过滤、错误检测
元数据
Slug log-parser
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Log Parser 是什么?

Parse and analyze various log formats (nginx, apache, syslog, application logs). Extract key information and generate reports. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 187 次。

如何安装 Log Parser?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install log-parser」即可一键安装,无需额外配置。

Log Parser 是免费的吗?

是的,Log Parser 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Log Parser 支持哪些平台?

Log Parser 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Log Parser?

由 freeter226(@freeter226)开发并维护,当前版本 v1.0.0。

💬 留言讨论