Show events from log files converting input date formats to a unique format: '%Y-%m-%d %H:%M:%S'.
Project description
grepbydate
Show events from log files converting input date formats to a unique format: '%Y-%m-%d %H:%M:%S'.
- Format dates in specified input files.
- Transparently works on *.gz and *.xz files.
- Transparently transforms audit.log timestamps.
- Shows full stack trace if starting line matches the filtering options.
- Optional filtering by a time range.
- Optional filtering by Regexp. (Optionally ignore case)
Usage
usage: grepbydate [-h] [-f DATE_FROM] [-i] [-t DATE_TO] [-s SEARCH] inputfiles [inputfiles ...]
Show events from log files converting input date formats to a unique format: '%Y-%m-%d %H:%M:%S'.
positional arguments:
inputfiles (Required). file/s to read.
options:
-h, --help show this help message and exit
-f, --from DATE_FROM (Optional). Filter from this datetime.
-i, --ignorecase (Optional). Ignore case on the search Regular Expression.
-t, --to DATE_TO (Optional). Filter until this datetime.
-s, --search SEARCH (Optional). Filter lines using this Regex.
Supported date format for `--from` and `--to` filters: ['%Y-%m-%d', '%Y-%m-%d %H', '%Y-%m-%d %H:%M', '%Y-%m-%d %H:%M:%S', '%Y-%m-%dT%H',
'%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S']
Examples
- Get events from
/var/logrecursively from a specific date to last available date:
grepbydate -f 2025-06-02 /var/log/
- Get events from
/var/logand/var/lib/pgsl/data/loginto a time range:
grepbydate -f "2025-06-02 12:34:07" -t "2025-06-02 12:34:09" /var/log/ /var/lib/pgsql/data/log/
- Get events from input files matching
Katello.*errorregular expresion.
grepbydate $(find /var/log/foreman/ -type f) -s "Katello.*error"
- Get
openedandclosedsessions from/var/log/secure-2025*ignoring case.
grepbydate /var/log/secure-2025* -s "OPEned|CLosed" -i
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grepbydate-0.0.2.tar.gz.
File metadata
- Download URL: grepbydate-0.0.2.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5866a20c4fa1ec3800114043abb30714c6eaadab6275341d7a8c8ee966f55a96
|
|
| MD5 |
dbb574fd9103ab2fd65caebc6fdc2738
|
|
| BLAKE2b-256 |
38ed5892c9fa7c67bd9018e5bb08bfe85d2792e7cbd6059905ba2bafcd6373b6
|
Provenance
The following attestation bundles were made for grepbydate-0.0.2.tar.gz:
Publisher:
publish-pypi.yml on pafernanr/grepbydate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grepbydate-0.0.2.tar.gz -
Subject digest:
5866a20c4fa1ec3800114043abb30714c6eaadab6275341d7a8c8ee966f55a96 - Sigstore transparency entry: 1075895665
- Sigstore integration time:
-
Permalink:
pafernanr/grepbydate@58c387d8f67030dfd2cf159ff3a78ef23fb70afc -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/pafernanr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@58c387d8f67030dfd2cf159ff3a78ef23fb70afc -
Trigger Event:
release
-
Statement type:
File details
Details for the file grepbydate-0.0.2-py3-none-any.whl.
File metadata
- Download URL: grepbydate-0.0.2-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24473a31ca24ad8e0cef7aaee5787dcbb21ab757c523850ac7cb385bde133e5a
|
|
| MD5 |
235dcf6a96bb849ce8345bc25bd31a09
|
|
| BLAKE2b-256 |
dddc29ec1eda4ee53dc61fe6a53d0cd5405c78b8e3b978748e792df5ad602df8
|
Provenance
The following attestation bundles were made for grepbydate-0.0.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on pafernanr/grepbydate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grepbydate-0.0.2-py3-none-any.whl -
Subject digest:
24473a31ca24ad8e0cef7aaee5787dcbb21ab757c523850ac7cb385bde133e5a - Sigstore transparency entry: 1075895686
- Sigstore integration time:
-
Permalink:
pafernanr/grepbydate@58c387d8f67030dfd2cf159ff3a78ef23fb70afc -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/pafernanr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@58c387d8f67030dfd2cf159ff3a78ef23fb70afc -
Trigger Event:
release
-
Statement type: