Nginx error log parser.
This project provides a clean parsing of nginx error logs, produced by the
error_log
directive (not
access logs). The implementation is based on
this stackoverflow answer.
You can use this to parse Kong's logs.
git clone git@github.com:MyMusicTaste/nparser.git
cd nparser
pip install -e .
from nparser import parse_line
entry = parse_line('2019/10/01 07:16:38 [warn] 70#0: *3 [lua] balancer.lua:718: redistributeIndices(): [ringbalancer 4] redistributed indices, size=10000, dropped=10000, assigned=0, left unassigned=10000, context: ngx.timer')
print(entry.message)
MIT, see LICENSE.txt
.