piedweb/logs-analyzer
Composer 安装命令:
composer require piedweb/logs-analyzer
包简介
Can parse, filter and export to CSV via PHP or CLI your APACHE/Nginx/Microsoft/WhatYouWant logs.
README 文档
README
Logs Analyzer
This package can parse, filter and export to CSV via PHP or CLI your APACHE/Nginx/Microsoft/WhatYouWant logs.
FR: https://piedweb.com/seo/logs
Install
Via Packagist
$ composer require piedweb/logs-analyzer
Usage
Tu use it directly in php, see bin/analyzer example.
Else, you can use the command tools to filter and export to CSV your log files. Get the last args list via --help :
bin/analyzer --help
About --format
Default parser work with Apache Access Logs :
^(?P<host>[a-zA-Z0-9\-\._:]+) (?P<logname>(?:-|[\w-]+)) (?P<user>(?:-|[\w\-\.]+)) \[(?P<time>\d{2}/(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/\d{4}:\d{2}:\d{2}:\d{2} (?:-|\+)\d{4})\] "(?P<request>(?:(?:[A-Z]+) .+? HTTP/(1\.0|1\.1|2\.0))|-|)" (?P<status>\d{3}|-) (?P<responseBytes>(\d+|-)) "(?P<HeaderReferer>.*?)" "(?P<HeaderUserAgent>.*?)"$
You can change the regex directly via the CLI or by creating a new Class managing your special format. Your new class must extends \PiedWeb\LogsAnalyzer\LogLine.
About --resume
This arg permits to have only unique request (requestMethod + url + status) keeping only the first date and time and counting the number of hit
Testing
$ composer test
Contributing
Please see contributing
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 11.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-01-29