Skip to main content

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


Download files

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

Source Distribution

log_compactor-0.1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

log_compactor-0.1.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

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

Hashes for log_compactor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c0ee8544a2509c414ead34272b144c6c6a5090a63faa1e550dcd584ca4970ec
MD5 021bef58a04e358ef7d8660f0cefe84a
BLAKE2b-256 90f9497e533ddca3d4cc55298e320cd5429dc9a6d56261a9f0c5271d9fdb7c2b

See more details on using hashes here.

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

Hashes for log_compactor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6c7e9955d78366df92895102b3105edadb8c3cc814e69e86124617364bce58f
MD5 fcc4f07bf50c92cbe43549c800d3a4c4
BLAKE2b-256 95421189f7e8899edf3ec0521a351549e4b73ca7839b84f67eb29e128da32287

See more details on using hashes here.

Supported by

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