A real-time, configurable log deduplication and compaction tool.
Project description
Log Compactor
A real-time, configurable log deduplication and compaction utility. It supports dynamic regex parsing, key-value extraction, raw pass-through for unstructured lines, time-window deduplication, and error escalation.
Installation
From the project root (development):
pip install -e ".[dev]"
Or install the package only:
pip install -e .
The dev extra includes pytest.
Pipe any command’s output
Install the package, add a config.yaml (or pass --config), and pipe stdout through the CLI:
pytest -q 2>&1 | logcompact stream -c /path/to/config.yaml
python app.py 2>&1 | logcompact stream
If you omit -c, the CLI looks for config.yaml in the current working directory.
Library usage
from compactor import SmartCompactor
settings = {"dedup_window_seconds": 5, "error_threshold": 2}
compactor = SmartCompactor(settings)
for line in compactor.compact_stream(open("app.log")):
print(line)
Tests
pytest
Changelog
See CHANGELOG.md for version history and release notes.
License
This project is licensed under the GNU General Public License v3.0 only. See the LICENSE file for the full license text.
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 log_compactor-0.1.0.tar.gz.
File metadata
- Download URL: log_compactor-0.1.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c0ee8544a2509c414ead34272b144c6c6a5090a63faa1e550dcd584ca4970ec
|
|
| MD5 |
021bef58a04e358ef7d8660f0cefe84a
|
|
| BLAKE2b-256 |
90f9497e533ddca3d4cc55298e320cd5429dc9a6d56261a9f0c5271d9fdb7c2b
|
File details
Details for the file log_compactor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: log_compactor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6c7e9955d78366df92895102b3105edadb8c3cc814e69e86124617364bce58f
|
|
| MD5 |
fcc4f07bf50c92cbe43549c800d3a4c4
|
|
| BLAKE2b-256 |
95421189f7e8899edf3ec0521a351549e4b73ca7839b84f67eb29e128da32287
|