kassner / log-parser

PHP Web Server Log Parser Library
Apache License 2.0
339 stars 64 forks source link

Syslog support? #44

Closed cnizzardini closed 4 years ago

cnizzardini commented 4 years ago

Is there a way to use this to parse syslog? I get this went attempting to run it against syslog:

Exception: Apr  2 00:06:46 chris-x1 kernel: [347472.787552] mce: CPU6: Package temperature above threshold, cpu clock throttled (total events = 393711)
In [/var/www/personal/easyupp/vendor/kassner/log-parser/src/LogParser.php, line 82]

2020-04-02 22:40:00 Error: [Kassner\LogParser\FormatException] Apr  2 00:06:46 chris-x1 kernel: [347472.787552] mce: CPU6: Package temperature above threshold, cpu clock throttled (total events = 393711) in /var/www/personal/easyupp/vendor/kassner/log-parser/src/LogParser.php on line 82
Stack Trace:
- /var/www/personal/easyupp/src/Command/ReadSysLogCommand.php:21
- /var/www/personal/easyupp/vendor/cakephp/cakephp/src/Console/BaseCommand.php:175
- /var/www/personal/easyupp/vendor/cakephp/cakephp/src/Console/CommandRunner.php:336
- /var/www/personal/easyupp/vendor/cakephp/cakephp/src/Console/CommandRunner.php:171
- /var/www/personal/easyupp/bin/cake.php:12
kassner commented 4 years ago

@cnizzardini this library was never intended to parse anything other than access logs. Although you could set a custom format, like done in #21, I am not sure this is the right library for the job.