Skip to main content

Small NASA FTP logs analyzer

Project description

ireadlogs

This is a small python module that parses and analyzes logs such as ftp://ita.ee.lbl.gov/traces/NASA_access_log_Aug95.gz available at NASA-FTP (ftp://ita.ee.lbl.gov/traces/), and produces a JSON report with next information:

  1. Top requested pages and the number of requests made for each
  2. Percentage of successful requests (anything in the 200s and 300s range)
  3. Percentage of unsuccessful requests (anything that is not in the 200s or 300s range)
  4. Top 10 unsuccessful page requests
  5. The top 10 hosts making the most requests, displaying the IP address and number of requests made.
  6. For each of the top hosts, show the top 5 pages requested and the number of requests for each page
  7. The log file contains malformed entries; for each malformed line, display an error message and the line number.

Command line options may alter the produced results with regards to the number of top hosts and pages, the top hosts - pages breakdown and the reporting of errors.

Prerequisites

You need python >= 3.6 and virtualenv installed in your system.

Installation

Create a python virtual environment virtualenv -p $(which python3) venv

Activate it . venv/bin/activate

Install ireadlogs from pypi: pip install ireadlogs -U

Usage

ireadlogs path_to_logfile

Getting help

ireadlogs -h

Command line options

ireadlogs [-h] [--pages PAGES] [--hosts HOSTS]
               [--hosts-breakdown HOSTS_BREAKDOWN] [--show-errors]
               logfile

positional arguments:
  logfile

optional arguments:
  -h, --help            show this help message and exit
  --pages PAGES         limits the top pages shown (default is 10)
  --hosts HOSTS         limits the top hosts shown (default is 10)
  --hosts-breakdown HOSTS_BREAKDOWN
                        limits the top pages per host breakdown (default is 5)
  --show-errors         if present show malformed line numbers

Build

make build

Distribute

make distribute

Run tests

make test

Install locally for dev

After creating and activating a python3.6+ virtualenv: pip install -e .

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

ireadlogs-0.0.12.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ireadlogs-0.0.12-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file ireadlogs-0.0.12.tar.gz.

File metadata

  • Download URL: ireadlogs-0.0.12.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

File hashes

Hashes for ireadlogs-0.0.12.tar.gz
Algorithm Hash digest
SHA256 d5f53824e69d2eb21b6cb42fb3f29e00ab3f373af6301c24ace159808bcf48dc
MD5 2eb6ef4c62437c46a879c44f8ba98511
BLAKE2b-256 81a7e0f8b54733012d9613575c730ef0b93ecd694f4da9421b3ed18dab3672bf

See more details on using hashes here.

File details

Details for the file ireadlogs-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: ireadlogs-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

File hashes

Hashes for ireadlogs-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 e9e2385825f5781eaa7e2d2d62f5a7d46feaad0252c36b6ed93f48dab701e588
MD5 d95e7ab5da5d5fe246fedb4c33288b50
BLAKE2b-256 907f5314412001280a293c402235851477a13323ddd1a23816072429a0eb41a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page