This release is a pre-release and may not be stable for production use.
Python nginx Log Parser
Parse nginx logs with Python.
Free software: MIT license
<! – Docs not yet published * Documentation: https://nginxlib.readthedocs.io. –>
This package parses nginx logs and provides a Python object representing each log. It also has some procedures to aggregate log data.
Installation
With pip:
$ pip install nginxlib
For development:
$ python setup.py develop
Run the tests:
$ make test
Features
Parse a discrete nginx log entry to a Python object
Aggregate log data
Usage
Given this nginx log entry:
` 96.49.212.83 - - [16/Jun/2019:22:52:21 +0000] "GET /vs/editor/editor.main.nls.js HTTP/1.1" 200 34027 "https://3000-98358490.staging-avl.appsembler.com/" "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='3000-98358490.staging-avl.appsembler.com', path='', params='', query='', fragment='')
>>> entry.deploy_id
'98358490'
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Inspired by and forked from: https://code.richard.do/explore/projects.
History
0.1.0-alpha (2019-06-17)
First release on PyPI.
Port the original repo
Add procedures to parse discrete logs
Release files for nginxlib 0.1.0a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nginxlib-0.1.0a0.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nginxlib-0.1.0a0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 19.7 kB
Release files / nginxlib-0.1.0a0.tar.gz
| Download URL | nginxlib-0.1.0a0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bb3d73397040db39737eee96ff9931c953176c6625ef42861afae7fba03addc
|
|
BLAKE2b-256 checksum How to use checksums |
95d96ca8d62cd2d2d6b2873f8194b7255bb558b7899ab84fd17d91f09854e694
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / nginxlib-0.1.0a0-py2.py3-none-any.whl
| Download URL | nginxlib-0.1.0a0-py2.py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a727a30b3e60151b2fe09367a3e72a59fd637109d006b507472fdd60034a6cf7
|
|
BLAKE2b-256 checksum How to use checksums |
f55382f208f7e744154a4d082078d27abeedce314d252c024783af32ab3c0b83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|