Skip to main content

Parse nginx logs.

Project description

Python nginx Log Parser

Parse nginx logs with Python. Documentation Status
  • Free software: MIT license

<! – Docs not yet published * Documentation: –>

This package parses nginx logs and provides a Python object representing each log. It also has some procedures to aggregate log data.


With pip:

$ pip install nginxlib

For development:

$ python develop

Run the tests:

$ make test


  • Parse a discrete nginx log entry to a Python object

  • Aggregate log data


Given this nginx log entry:

` - - [16/Jun/2019:22:52:21 +0000] "GET /vs/editor/editor.main.nls.js HTTP/1.1" 200 34027 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:67.0) Gecko/20100101 Firefox/67.0" "-" # noqa E503 `

the entryparse object will behave as follows:

>>> from nginxparser import entryparse

>>> entry = entryparse(log_string)
>>> entry.timestamp
datetime.datetime(2019, 6, 16, 23, 54, 5, 624139)
>>> entry.url
ParseResult(scheme='https', netloc='', path='', params='', query='', fragment='')
>>> entry.deploy_id



0.1.0-alpha (2019-06-17)

  • First release on PyPI.

  • Port the original repo

  • Add procedures to parse discrete logs

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nginxlib-0.1.0a0.tar.gz (12.4 kB view hashes)

Uploaded source

Built Distribution

nginxlib-0.1.0a0-py2.py3-none-any.whl (7.3 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page