LogParser
LogParser is a web application that can be used to parse log files from other programs. It can parse arbitrary log formats (which users may specify) into more accessible ones.
Features
- Arbitrary Log Format Parsing
- Database Storage
- CSV Output
- Tabular Data Output
Requirements
- A web server of your choice
- PHP >= 5.0
- PostgreSQL
Install
Copy the contents of the LogParser folder to a directory of your choice and run db.sql. You must also edit logparser.php and replace , , , with data that's appropriate for your database.
Usage
Logs can be provided through either text input or file input. Text input is limited to 4KB while file input is limited to 1MB files. After specifying a log file, you must define a log parse format. The parse format consists of text which contains capture groups ($n where n is a number). The parser attempts to match log data with the parse format up until it encounters a capture group, where it captures text until the next character matches the character right after the capture group identifier in the parse format string. Example:
- Log Data: Hello - world; Greetings 21/12/2000
- Parse Format: $1 - $2; $3 $4/$5/$6
- Output: An array containing "Hello", "world", "Greetings", "21", "12", "2000".
TODO
- Ending marker support (in order to support log entries that do not end in newlines, which is needed to handle logs like those generated by Filesender)
- Filtering
- Named data captures
- Improve performance
- SSL support
License
LogParser is published under the terms of the MIT License.