An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          


Open Source Package

# Logs Analyzer

[![Latest Version](https://img.shields.io/github/tag/PiedWeb/LogsAnalyzer.svg?style=flat&label=release)](https://github.com/PiedWeb/LogsAnalyzer/tags)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/PiedWeb/LogsAnalyzer/Tests?label=tests)](https://github.com/PiedWeb/LogsAnalyzer/actions)
[![Quality Score](https://img.shields.io/scrutinizer/g/PiedWeb/LogsAnalyzer.svg?style=flat)](https://scrutinizer-ci.com/g/PiedWeb/LogsAnalyzer)
[![Code Coverage](https://codecov.io/gh/PiedWeb/LogsAnalyzer/branch/main/graph/badge.svg)](https://codecov.io/gh/PiedWeb/LogsAnalyzer/branch/main)
[![Type Coverage](https://shepherd.dev/github/PiedWeb/LogsAnalyzer/coverage.svg)](https://shepherd.dev/github/PiedWeb/LogsAnalyzer)
[![Total Downloads](https://img.shields.io/packagist/dt/piedweb/logs-analyzer.svg?style=flat)](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.

[![Latest Version](https://img.shields.io/github/tag/PiedWeb/LogsAnalyzer.svg?style=flat&label=release)](https://github.com/PiedWeb/LogsAnalyzer/tags)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/PiedWeb/LogsAnalyzer/blob/master/LICENSE)
[![Build Status](https://img.shields.io/travis/PiedWeb/LogsAnalyzer/master.svg?style=flat)](https://travis-ci.org/PiedWeb/LogsAnalyzer)
[![Quality Score](https://img.shields.io/scrutinizer/g/PiedWeb/LogsAnalyzer.svg?style=flat)](https://scrutinizer-ci.com/g/PiedWeb/LogsAnalyzer)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/PiedWeb/LogsAnalyzer.svg?style=flat)](https://scrutinizer-ci.com/g/PiedWeb/LogsAnalyzer/code-structure)
[![Total Downloads](https://img.shields.io/packagist/dt/piedweb/logs-analyzer.svg?style=flat)](https://packagist.org/packages/piedweb/logs-analyzer)