Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

logtime

Parse the date and time from log files and print an ASCII graph of the occurrences. Time can be grouped by minute, hour or day.

matth-at-mtingers.com

Usage

Usage:
     logtime <grouping> <timepattern> <timespec> < FILENAME

Example Usage:
   Apache logs grouped by hour
     grep FOO /var/log/apache2/access.log | \
         logtime H '\[(.+?) ' '%d/%b/%Y:%H:%M:%S'

     logtime H '\[(.+?) ' '%d/%b/%Y:%H:%M:%S' < /path/file

Grouping spec:
     H - hour
     M - Minute
     S - Second
     y - year
     m - month
     d - day

Timespecs:
     Directive   Meaning
     %a  Locale's abbreviated weekday name.
     %A  Locale's full weekday name.
     %b  Locale's abbreviated month name.
     %B  Locale's full month name.
     %c  Locale's appropriate date and time representation
     %d  Day of the month as a decimal number [01,31]
     %H  Hour (24-hour clock) as a decimal number [00,23]
     %I  Hour (12-hour clock) as a decimal number [01,12]
     %j  Day of the year as a decimal number [001,366]
     %m  Month as a decimal number [01,12]
     %M  Minute as a decimal number [00,59].
     %p  Locale's equivalent of either AM or PM.
     %S  Second as a decimal number [00,61].
     %U  Week number of the year (Sunday as the first day of the
         week) as a decimal number [00,53].
     %w  Weekday as a decimal number [0(Sunday),6]
     %W  Week number of the year (Monday as the first day of the
         week) as a decimal number [00,53].
     %x  Locale's appropriate date representation
     %X  Locale's appropriate time representation
     %y  Year without century as a decimal number [00,99]
     %Y  Year with century as a decimal number
     %Z  Time zone name (no characters if no time zone exists)
     %%  A literal '%' character.

Important notes:
     Regex is Python regex re.findall()
     Timepsec is Python's time module

Download files

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

Source Distribution

logtime-1.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

logtime-1.0.1-py3.8.egg (3.6 kB view details)

Uploaded Egg

File details

Details for the file logtime-1.0.1.tar.gz.

File metadata

  • Download URL: logtime-1.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2

File hashes

Hashes for logtime-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8e8fd7c90c66dc3a76aab86b755a78e894766ec280f3e2c8ff3c3c60f0dfaffe
MD5 cd82bf7d86e2b97e8074aa1e1f2d2912
BLAKE2b-256 fb546761eeb3fc016f80e9549106bc03fb779f2a7cf7fe1d5bf678af7ee3a697

See more details on using hashes here.

File details

Details for the file logtime-1.0.1-py3.8.egg.

File metadata

  • Download URL: logtime-1.0.1-py3.8.egg
  • Upload date:
  • Size: 3.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2

File hashes

Hashes for logtime-1.0.1-py3.8.egg
Algorithm Hash digest
SHA256 7e7f5408857aa65ff2560f3465fc07e3d732da0aba53df396cd24ee6908e2a9a
MD5 34a684fce95d3c1edcf8a022ec02e3d7
BLAKE2b-256 bcddfd32ff6eb2f9ba14ea9fe3e9f849ed20cdb9fc4be15ac6e2c97ca26b1617

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page