返回顶部
l

log-parser

Parse and analyze various log formats (nginx, apache, syslog, application logs). Extract key information and generate reports.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
125
下载量
0
收藏
概述
安装方式
版本历史

log-parser

# 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 ```bash python3 skills/log-parser/scripts/log_parser.py <action> [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) ```json {"timestamp": "2026-03-22T14:00:00Z", "level": "ERROR", "message": "..."} ``` ## Examples ```bash # 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: ```json { "success": true, "total": 1000, "parsed": 998, "entries": [...], "stats": {...} } ``` ## Current Status In development.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 log-parser-1776101710 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 log-parser-1776101710 技能

通过命令行安装

skillhub install log-parser-1776101710

下载 Zip 包

⬇ 下载 log-parser v1.0.0

文件大小: 5.08 KB | 发布时间: 2026-4-14 09:38

v1.0.0 最新 2026-4-14 09:38
首个版本:支持 nginx/apache/syslog/JSON 格式解析、统计、过滤、错误检测

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部