Skip to main content

No project description provided

Project description

Run tests PyPI version

errgrep

A cli for grep'ing through log files to find log statements matching a regex. Internally line timestamps, delimit 'log lines'. A line without a timestamp is considered to be part of the prior line. This allows for errgrep to find more complete exceptions (or other events) than just a single line from a file.

Installation

pip install errgrep

Usage

usage: errgrep [-h] [-i] [-a] [-C CONTEXT] regex [files [files ...]]

errgrep helps grep for multi-line statements in log files.

positional arguments:
  regex                 The regex used to search to search for statements.
  files                 Files to search. A "-" corresponds with reading from
                        stdin. If no files are given, will search stdin.

optional arguments:
  -h, --help            show this help message and exit
  -i, --ignore-case     If given, ignore case in search.
  -a, --allow-timestamp-format-changes
                        If given, assume the timestamp format can change
                        within a given file.
  -C CONTEXT, --context CONTEXT
                        If given, the number of lines of context to print
                        around matching lines. Can also be given as -NUM.

Example

errgrep --ignore-case error file.txt

See https://csm10495.github.io/errgrep/ for full API documentation.

License

MIT License

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

errgrep-0.0.6.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

errgrep-0.0.6-py3-none-any.whl (12.1 kB view hashes)

Uploaded Python 3

Supported by

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