Skip to main content
timegrep.py by Dennis Williamson 20100113
in response to http://serverfault.com/questions/101744/fast-extraction-of-a-time-range-from-syslog-logfile
Improvements by Fabrice FACORAT 20110914

Perform a binary search through a log file to find a range of times
and print the corresponding lines
Supported Log Formats:
- W3C Extended: %Y-%m-%d %H:%M:%S
- Syslog: %b %d %H:%M:%S
- NSCA Common/Apache: host rfc931 username [%d/%b/%Y:%H:%M:%S +TZ]
- Bind8: %d-%b-%Y %H:%M:%S.
- Nginx Error logs: %Y/%m/%d %H:%M:%S.
Tested with Python 2.6

TODO: Make sure that it works if the seek falls in the middle of
the first or last line
TODO: Make sure it's not blind to a line where the sync read falls
exactly at the beginning of the line being searched for and
then gets skipped by the second read
DONE: Support more log time format
TODO: Support case when log files may not be properly sorted ( remove superfluous lines )
DONE: Support on the fly log format definition with --log-regexp

Metadata

Release files for timegrep 1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for timegrep 1.5
File Size Uploaded Provenance
timegrep-1.5.tar.gz 5.5 kB Without provenance Details

Release files / timegrep-1.5.tar.gz

Download URL timegrep-1.5.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b3659a9035333bfbd9250145464cc8b8eaa43c75571367353fe2e5258af7a504
BLAKE2b-256 checksum
How to use checksums
1e5298074f1e44231083c3b8ce487553b231eab213d7510fb5d4d00dd4169971
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for timegrep 1.5

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.

Release history Release notifications | RSS feed

This release

1.5 This release

1 release file No provenance

1.0

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