https://github.com/piedweb/logsanalyzer
[PHP] This package can parse, filter and export to CSV via PHP or CLI your APACHE/Nginx/Microsoft/WhatYouWant logs.
https://github.com/piedweb/logsanalyzer
Last synced: about 1 year ago
JSON representation
[PHP] This package can parse, filter and export to CSV via PHP or CLI your APACHE/Nginx/Microsoft/WhatYouWant logs.
- Host: GitHub
- URL: https://github.com/piedweb/logsanalyzer
- Owner: PiedWeb
- License: mit
- Created: 2019-01-29T19:31:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-20T16:02:54.000Z (over 5 years ago)
- Last Synced: 2025-06-14T06:03:56.635Z (about 1 year ago)
- Language: PHP
- Homepage: https://dev.piedweb.com/
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Logs Analyzer
[](https://github.com/PiedWeb/LogsAnalyzer/tags)
[](LICENSE)
[](https://github.com/PiedWeb/LogsAnalyzer/actions)
[](https://scrutinizer-ci.com/g/PiedWeb/LogsAnalyzer)
[](https://codecov.io/gh/PiedWeb/LogsAnalyzer/branch/main)
[](https://shepherd.dev/github/PiedWeb/LogsAnalyzer)
[](https://packagist.org/packages/piedweb/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](https://packagist.org/packages/piedweb/logs-analyzer)
```bash
$ composer require piedweb/logs-analyzer
```
## Usage
Tu use it directly in php, see [bin/analyzer](https://github.com/PiedWeb/LogsAnalyzer/blob/master/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` :
```bash
bin/analyzer --help
```
### About `--format`
Default parser work with Apache Access Logs :
```
^(?P[a-zA-Z0-9\-\._:]+) (?P(?:-|[\w-]+)) (?P(?:-|[\w\-\.]+)) \[(?P
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
```bash
$ composer test
```
## Contributing
Please see [contributing](https://dev.piedweb.com/contributing)
## Credits
- [PiedWeb](https://piedweb.com)
- [All Contributors](https://github.com/PiedWeb/:package_skake/graphs/contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.
[](https://github.com/PiedWeb/LogsAnalyzer/tags)
[](https://github.com/PiedWeb/LogsAnalyzer/blob/master/LICENSE)
[](https://travis-ci.org/PiedWeb/LogsAnalyzer)
[](https://scrutinizer-ci.com/g/PiedWeb/LogsAnalyzer)
[](https://scrutinizer-ci.com/g/PiedWeb/LogsAnalyzer/code-structure)
[](https://packagist.org/packages/piedweb/logs-analyzer)