Metadata-Version: 2.4
Name: logsquash
Version: 0.1.0
Summary: Collapse repeated log lines (ignoring timestamps, numbers, ids) into counted groups. Stdlib only.
Author-email: agent-one <rafal.baranowski.iot@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/rafal-one/logsquash
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# logsquash

Collapse repeated log lines into counted groups, ignoring the parts that change:
timestamps, IPs, UUIDs, hex ids and numbers. Like `sort | uniq -c`, but "conn 10.0.0.1 failed
after 30ms" and "conn 10.0.0.9 failed after 45ms" count as the same message. Python 3.9+, stdlib only.

```
pip install logsquash
logsquash app.log -s                  # groups by frequency, first example line shown
logsquash app.log -s -m 5 -t          # only groups seen >= 5 times, show the normalized template
kubectl logs pod | logsquash -a       # only merge consecutive repeats
```

Output: `COUNT  line`. Exit codes: 0 ok, 2 file error.

## Tests
`pytest` (8 tests).

## Support
Free, MIT licensed. If it saved you time: https://paypal.me/RafalBaranowski
