This release is a pre-release and may not be stable for production use.
AccessLog Parser and CLI
Web server access log parser and CLI tool with added features for web archive replay logs.
Installation
This package requires Python 3.6 or above.
Install the latest version of the released package and accesslog CLI tool from PyPi:
$ pip install accesslog
Alternatively, build and install the development version of the package:
$ git clone https://github.com/oduwsdl/accesslog-parser.git
$ cd accesslog-parser
$ python3 setup.py install
$ accesslog --version
Input Parsing
TODO
Record Filtering
TODO
Output Formatting
TODO
CLI Reference
$ accesslog -h
usage: accesslog [options] [FILES ...]
A tool to parse Common Log formatted access logs with various derived fields.
positional arguments:
files Log files (plain/gz/bz2) to parse (reads from the STDIN, if empty or '-')
optional arguments:
-h, --help Show this help message and exit
-v, --version Show version number and exit
-d, --debug Show debug messages on STDERR
-e FIELDS, --nonempty FIELDS
Skip record if any of the provided fields is empty (comma separated list)
-i FIELDS, --valid FIELDS
Skip record if any of the provided field values are invalid
('all' or comma separated list from 'host,request,status,size,referrer')
-m FIELD~RegExp, --match FIELD~RegExp
Skip record if field does not match the RegExp (can be used multiple times)
-t TFORMAT, --origtime TFORMAT
Original datetime format of logs (default: '%d/%b/%Y:%H:%M:%S %z')
-f FORMAT, --format FORMAT
Output format string (see available formatting fields below)
-j FIELDS, --json FIELDS
Output NDJSON with the provided fields (use 'all' for all fields except 'origline')
formatting fields:
{origline} Original log line
{host} IP address of the client
{identity} Identity of the client, usually '-'
{user} User ID for authentication, usually '-'
{origtime} Original date and time (typically in '%d/%b/%Y:%H:%M:%S %z' format)
{epoch} Seconds from the Unix epoch (derived from origtime)
{date} UTC date in '%Y-%m-%d' format (derived from origtime)
{time} UTC time in '%H:%M:%S' format (derived from origtime)
{datetime} 14 digit datetime in '%Y%m%d%H%M%S' format (derived from origtime)
{request} Original HTTP request line
{method} HTTP method (empty for invalid request)
{path} Path and query (scheme and host removed, empty for invalid request)
{prefix} Memento endpoint path prefix (derived from path)
{mtime} 14 digit Memento datetime (derived from path)
{rflag} Memento rewrite flag (derived from path)
{urir} Memento URI-R (derived from path)
{httpv} HTTP version (empty for invalid request)
{status} Returned status code
{size} Number of bytes returned
{referrer} Referer header (empty, if not logged)
{agent} User-agent header (empty, if not logged)
{extras} Any additional logged fields
Default FORMAT: '{host} {date} {time} {method} {path} {status} {size} "{referrer}" "{agent}"'
Metadata
Release files for accesslog 0.1.0b5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| accesslog-0.1.0b5.tar.gz | 5.6 kB | Without provenance | Details for accesslog-0.1.0b5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| accesslog-0.1.0b5-py3-none-any.whl | Python 3 | none | any | Details for accesslog-0.1.0b5-py3-none-any.whl |
Total release size: 13.3 kB
Release files / accesslog-0.1.0b5.tar.gz
| Download URL | accesslog-0.1.0b5.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5982b7403b530687b5c77e2b6686b301d473c524cfab1891c9c87072b3bcf6e5
|
|
BLAKE2b-256 checksum How to use checksums |
473cd57ed335401f005094fda4d34d84b2481f641f8b159faf2bcd371eb371cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / accesslog-0.1.0b5-py3-none-any.whl
| Download URL | accesslog-0.1.0b5-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e06b1bf7ec8daed2dfe93d549a3470dd04b71d6c8eae6446dc8073ae236a13c4
|
|
BLAKE2b-256 checksum How to use checksums |
bbead4d11025642a24ba1b62e66909ae1a8dd02e30a0503c87e1d75eae50c547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for accesslog 0.1.0b5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.