petit-log-crunchtools 3.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- petit_log_crunchtools-3.1.1/.gitignore +11 -0
- petit_log_crunchtools-3.1.1/AUTHORS +2 -0
- petit_log_crunchtools-3.1.1/CHANGELOG.md +304 -0
- petit_log_crunchtools-3.1.1/COPYING +666 -0
- petit_log_crunchtools-3.1.1/PKG-INFO +170 -0
- petit_log_crunchtools-3.1.1/README +145 -0
- petit_log_crunchtools-3.1.1/pyproject.toml +86 -0
- petit_log_crunchtools-3.1.1/src/petit/CrunchLog.py +728 -0
- petit_log_crunchtools-3.1.1/src/petit/Filter.py +103 -0
- petit_log_crunchtools-3.1.1/src/petit/LogGraph.py +557 -0
- petit_log_crunchtools-3.1.1/src/petit/LogHash.py +393 -0
- petit_log_crunchtools-3.1.1/src/petit/__init__.py +52 -0
- petit_log_crunchtools-3.1.1/src/petit/api.py +217 -0
- petit_log_crunchtools-3.1.1/src/petit/cli.py +329 -0
- petit_log_crunchtools-3.1.1/src/petit/data/filters/daemon.stopwords +6 -0
- petit_log_crunchtools-3.1.1/src/petit/data/filters/hash.stopwords +10 -0
- petit_log_crunchtools-3.1.1/src/petit/data/filters/host.stopwords +1 -0
- petit_log_crunchtools-3.1.1/src/petit/data/filters/words.stopwords +204 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/fedora11-reboot-dell.fp +650 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel4-reboot-dl380.fp +654 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel4-reboot-vmware.fp +309 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel5-reboot-dl380.fp +336 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/rhel5-reboot-vmware.fp +268 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/ubuntu10.04-reboot-kvm.fp +330 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprint_library/ubuntu9.04-reboot-vmware.fp +359 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/fedora11-reboot.fp +650 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/rhel4-reboot.fp +966 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/rhel5-reboot.fp +604 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/ubuntu10.04-reboot.fp +330 -0
- petit_log_crunchtools-3.1.1/src/petit/data/fingerprints/ubuntu9.04-reboot.fp +359 -0
- petit_log_crunchtools-3.1.1/src/petit/errors.py +28 -0
- petit_log_crunchtools-3.1.1/src/petit/resources.py +58 -0
- petit_log_crunchtools-3.1.1/test/README +32 -0
- petit_log_crunchtools-3.1.1/test/data/test01.log +115 -0
- petit_log_crunchtools-3.1.1/test/data/test02.log +6 -0
- petit_log_crunchtools-3.1.1/test/data/test03.log +100 -0
- petit_log_crunchtools-3.1.1/test/data/test04.log +6 -0
- petit_log_crunchtools-3.1.1/test/data/test05.log +419 -0
- petit_log_crunchtools-3.1.1/test/data/test06.log +1070 -0
- petit_log_crunchtools-3.1.1/test/data/test07.log +500 -0
- petit_log_crunchtools-3.1.1/test/data/test08.log +1500 -0
- petit_log_crunchtools-3.1.1/test/data/test09.log +197 -0
- petit_log_crunchtools-3.1.1/test/data/test10.log +491 -0
- petit_log_crunchtools-3.1.1/test/data/test11.log +39 -0
- petit_log_crunchtools-3.1.1/test/data/test12.log +84 -0
- petit_log_crunchtools-3.1.1/test/data/test13.log +0 -0
- petit_log_crunchtools-3.1.1/test/output/test01-daemon.output +4 -0
- petit_log_crunchtools-3.1.1/test/output/test01-dgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test01-hash-fingerprint.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test01-hash-nofilter.output +75 -0
- petit_log_crunchtools-3.1.1/test/output/test01-hash-nosample.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test01-hash.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test01-hgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test01-host.output +20 -0
- petit_log_crunchtools-3.1.1/test/output/test01-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test01-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test01-sgraph.output +15 -0
- petit_log_crunchtools-3.1.1/test/output/test01-wordcount.output +23 -0
- petit_log_crunchtools-3.1.1/test/output/test01-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test02-daemon.output +0 -0
- petit_log_crunchtools-3.1.1/test/output/test02-dgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test02-hash-fingerprint.output +6 -0
- petit_log_crunchtools-3.1.1/test/output/test02-hash-nofilter.output +6 -0
- petit_log_crunchtools-3.1.1/test/output/test02-hash-nosample.output +6 -0
- petit_log_crunchtools-3.1.1/test/output/test02-hash.output +6 -0
- petit_log_crunchtools-3.1.1/test/output/test02-hgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test02-host.output +0 -0
- petit_log_crunchtools-3.1.1/test/output/test02-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test02-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test02-sgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test02-wordcount.output +6 -0
- petit_log_crunchtools-3.1.1/test/output/test02-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test03-daemon.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test03-dgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test03-hash-fingerprint.output +19 -0
- petit_log_crunchtools-3.1.1/test/output/test03-hash-nofilter.output +39 -0
- petit_log_crunchtools-3.1.1/test/output/test03-hash-nosample.output +19 -0
- petit_log_crunchtools-3.1.1/test/output/test03-hash.output +19 -0
- petit_log_crunchtools-3.1.1/test/output/test03-hgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test03-host.output +39 -0
- petit_log_crunchtools-3.1.1/test/output/test03-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test03-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test03-sgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test03-wordcount.output +20 -0
- petit_log_crunchtools-3.1.1/test/output/test03-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test04-daemon.output +0 -0
- petit_log_crunchtools-3.1.1/test/output/test04-dgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test04-hash-fingerprint.output +2 -0
- petit_log_crunchtools-3.1.1/test/output/test04-hash-nofilter.output +6 -0
- petit_log_crunchtools-3.1.1/test/output/test04-hash-nosample.output +2 -0
- petit_log_crunchtools-3.1.1/test/output/test04-hash.output +2 -0
- petit_log_crunchtools-3.1.1/test/output/test04-hgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test04-host.output +0 -0
- petit_log_crunchtools-3.1.1/test/output/test04-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test04-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test04-sgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test04-wordcount.output +3 -0
- petit_log_crunchtools-3.1.1/test/output/test04-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test05-daemon.output +55 -0
- petit_log_crunchtools-3.1.1/test/output/test05-dgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test05-hash-fingerprint.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test05-hash-nofilter.output +376 -0
- petit_log_crunchtools-3.1.1/test/output/test05-hash-nosample.output +305 -0
- petit_log_crunchtools-3.1.1/test/output/test05-hash.output +305 -0
- petit_log_crunchtools-3.1.1/test/output/test05-hgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test05-host.output +21 -0
- petit_log_crunchtools-3.1.1/test/output/test05-mgraph.output +15 -0
- petit_log_crunchtools-3.1.1/test/output/test05-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test05-sgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test05-wordcount.output +827 -0
- petit_log_crunchtools-3.1.1/test/output/test05-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test06-daemon.output +64 -0
- petit_log_crunchtools-3.1.1/test/output/test06-dgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test06-hash-fingerprint.output +16 -0
- petit_log_crunchtools-3.1.1/test/output/test06-hash-nofilter.output +969 -0
- petit_log_crunchtools-3.1.1/test/output/test06-hash-nosample.output +747 -0
- petit_log_crunchtools-3.1.1/test/output/test06-hash.output +747 -0
- petit_log_crunchtools-3.1.1/test/output/test06-hgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test06-host.output +22 -0
- petit_log_crunchtools-3.1.1/test/output/test06-mgraph.output +15 -0
- petit_log_crunchtools-3.1.1/test/output/test06-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test06-sgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test06-wordcount.output +1820 -0
- petit_log_crunchtools-3.1.1/test/output/test06-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test07-daemon.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test07-dgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test07-hash-fingerprint.output +7 -0
- petit_log_crunchtools-3.1.1/test/output/test07-hash-nofilter.output +494 -0
- petit_log_crunchtools-3.1.1/test/output/test07-hash-nosample.output +7 -0
- petit_log_crunchtools-3.1.1/test/output/test07-hash.output +7 -0
- petit_log_crunchtools-3.1.1/test/output/test07-hgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test07-host.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test07-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test07-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test07-sgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test07-wordcount.output +50 -0
- petit_log_crunchtools-3.1.1/test/output/test07-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test08-daemon.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test08-dgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test08-hash-fingerprint.output +8 -0
- petit_log_crunchtools-3.1.1/test/output/test08-hash-nofilter.output +1494 -0
- petit_log_crunchtools-3.1.1/test/output/test08-hash-nosample.output +8 -0
- petit_log_crunchtools-3.1.1/test/output/test08-hash.output +8 -0
- petit_log_crunchtools-3.1.1/test/output/test08-hgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test08-host.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test08-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test08-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test08-sgraph.output +15 -0
- petit_log_crunchtools-3.1.1/test/output/test08-wordcount.output +30 -0
- petit_log_crunchtools-3.1.1/test/output/test08-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test09-daemon.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test09-dgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test09-hash-fingerprint.output +18 -0
- petit_log_crunchtools-3.1.1/test/output/test09-hash-nofilter.output +105 -0
- petit_log_crunchtools-3.1.1/test/output/test09-hash-nosample.output +18 -0
- petit_log_crunchtools-3.1.1/test/output/test09-hash.output +18 -0
- petit_log_crunchtools-3.1.1/test/output/test09-hgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test09-host.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test09-mgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test09-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test09-sgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test09-wordcount.output +59 -0
- petit_log_crunchtools-3.1.1/test/output/test09-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test10-daemon.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test10-dgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test10-hash-fingerprint.output +139 -0
- petit_log_crunchtools-3.1.1/test/output/test10-hash-nofilter.output +486 -0
- petit_log_crunchtools-3.1.1/test/output/test10-hash-nosample.output +428 -0
- petit_log_crunchtools-3.1.1/test/output/test10-hash.output +428 -0
- petit_log_crunchtools-3.1.1/test/output/test10-hgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test10-host.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test10-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test10-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test10-sgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test10-wordcount.output +1157 -0
- petit_log_crunchtools-3.1.1/test/output/test10-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test11-daemon.output +2 -0
- petit_log_crunchtools-3.1.1/test/output/test11-dgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test11-hash-fingerprint.output +4 -0
- petit_log_crunchtools-3.1.1/test/output/test11-hash-nofilter.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test11-hash-nosample.output +4 -0
- petit_log_crunchtools-3.1.1/test/output/test11-hash.output +4 -0
- petit_log_crunchtools-3.1.1/test/output/test11-hgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test11-host.output +2 -0
- petit_log_crunchtools-3.1.1/test/output/test11-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test11-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test11-sgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test11-wordcount.output +16 -0
- petit_log_crunchtools-3.1.1/test/output/test11-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test12-daemon.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test12-dgraph.output +15 -0
- petit_log_crunchtools-3.1.1/test/output/test12-hash-fingerprint.output +30 -0
- petit_log_crunchtools-3.1.1/test/output/test12-hash-nofilter.output +57 -0
- petit_log_crunchtools-3.1.1/test/output/test12-hash-nosample.output +30 -0
- petit_log_crunchtools-3.1.1/test/output/test12-hash.output +30 -0
- petit_log_crunchtools-3.1.1/test/output/test12-hgraph.output +15 -0
- petit_log_crunchtools-3.1.1/test/output/test12-host.output +1 -0
- petit_log_crunchtools-3.1.1/test/output/test12-mgraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test12-mograph.output +13 -0
- petit_log_crunchtools-3.1.1/test/output/test12-sgraph.output +14 -0
- petit_log_crunchtools-3.1.1/test/output/test12-wordcount.output +90 -0
- petit_log_crunchtools-3.1.1/test/output/test12-ygraph.output +13 -0
- petit_log_crunchtools-3.1.1/test/test_api.py +367 -0
- petit_log_crunchtools-3.1.1/test/test_cli.py +129 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [3.1.1] - 2026-09-20
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- The 3.1.0 PyPI upload was rejected (trusted publisher was registered as a
|
|
14
|
+
new-project pending publisher instead of on the existing project's
|
|
15
|
+
Publishing settings). While fixing this on PyPI, the distribution name
|
|
16
|
+
changed to `petit-log-crunchtools`, matching the naming convention
|
|
17
|
+
already used elsewhere in the crunchtools fleet (`gatehouse-crunchtools`,
|
|
18
|
+
`mcp-gemini-crunchtools`). `petit --version` now looks up the installed
|
|
19
|
+
package under the new name; it would otherwise report "unknown" once
|
|
20
|
+
installed from PyPI.
|
|
21
|
+
|
|
22
|
+
## [3.1.0] - 2026-09-20
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- Relicensed from GPL-3.0-or-later to AGPL-3.0-or-later, per the
|
|
26
|
+
[crunchtools constitution](https://github.com/crunchtools/constitution).
|
|
27
|
+
Scott McCarty is the sole copyright holder.
|
|
28
|
+
- Raised the minimum supported Python from 3.9 to 3.11, matching the
|
|
29
|
+
constitution's CLI Tool profile.
|
|
30
|
+
- Rewrote the CLI argument parser from `optparse` to `argparse` (profile
|
|
31
|
+
mandates argparse; `optparse` is legacy stdlib). Every flag, default, and
|
|
32
|
+
the `--help` text are unchanged; the mode dispatch no longer uses `eval()`.
|
|
33
|
+
- Added type annotations across the library so `mypy --strict` passes with
|
|
34
|
+
zero errors.
|
|
35
|
+
- Converted `CHANGELOG` (RPM-style) to `CHANGELOG.md` (Keep a Changelog).
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- `.github/workflows/`: CI (lint, mypy, pytest on 3.11/3.12, Gourmand,
|
|
39
|
+
container build, constitution validation), a weekly security scan (CVE
|
|
40
|
+
audit + CodeQL), dual-registry container publishing (Quay.io + GHCR), and
|
|
41
|
+
PyPI trusted publishing on release tags.
|
|
42
|
+
- `Containerfile` on the Hummingbird multi-stage build pattern.
|
|
43
|
+
- `.specify/memory/constitution.md` declaring the CLI Tool profile.
|
|
44
|
+
- `gourmand.toml` / `gourmand-exceptions.toml`.
|
|
45
|
+
- `.github/dependabot.yml` for the `uv` and `github-actions` ecosystems.
|
|
46
|
+
- `uv.lock`, committed per constitution XV.
|
|
47
|
+
- `test/test_cli.py`: CLI integration tests covering the exit code contract
|
|
48
|
+
(0/1/2) and byte-for-byte output regression against the existing
|
|
49
|
+
`test/data`/`test/output` fixtures.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
- `petit --version` printed a hardcoded `2.0.0` since the 2.0.0 release; it
|
|
53
|
+
now reports the installed package version.
|
|
54
|
+
|
|
55
|
+
### Removed
|
|
56
|
+
- The legacy `Makefile`, `build/` (rpm/deb/tar/distutils scripts), and
|
|
57
|
+
`distribute/` directories — superseded by `uv build` + CI.
|
|
58
|
+
- `src/petit/ScriptLog.py`: dead code, unreferenced by the package and
|
|
59
|
+
unimportable under Python 3 (`import sha`, a Python 2-only module) since
|
|
60
|
+
the 2.0.0 port.
|
|
61
|
+
- `test/test.sh`: superseded by `test/test_cli.py`.
|
|
62
|
+
|
|
63
|
+
## [3.0.0] - 2026-09-19
|
|
64
|
+
|
|
65
|
+
### Changed
|
|
66
|
+
- **BREAKING**: the import package is now `petit`, not `crunchtools`. Update
|
|
67
|
+
`from crunchtools import hash_text` to `from petit import hash_text`.
|
|
68
|
+
- **BREAKING**: the PyPI distribution is now `petit-log`, not `crunchtools`.
|
|
69
|
+
`crunchtools` was this project's brand, not this tool's name — spending it
|
|
70
|
+
on one log analyser left nothing for anything else that ships under it,
|
|
71
|
+
and meant the repo, the distribution, the import and the command were
|
|
72
|
+
four different words for one program. `petit` alone was unavailable on
|
|
73
|
+
PyPI (a protein engineering toolkit holds it), hence `petit-log`.
|
|
74
|
+
- The repository moved to `github.com/crunchtools/petit`.
|
|
75
|
+
- The `petit` command and every flag are unchanged, as is the library API
|
|
76
|
+
beyond the import path: `hash_text`, `analyze_text`, `detect_format`,
|
|
77
|
+
`Group`, `Analysis`, and the `PetitError` hierarchy all behave exactly as
|
|
78
|
+
in 2.2.0.
|
|
79
|
+
- `crunchtools` 2.1.0 remains on PyPI and is not superseded by an upload;
|
|
80
|
+
the name is being kept for a future package under that brand.
|
|
81
|
+
|
|
82
|
+
## [2.2.0] - 2026-09-19
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
- Made driver selection deterministic. `select()` drew its sample lines
|
|
86
|
+
with `random.choice()`, so the driver — and therefore the entire result —
|
|
87
|
+
was a function of the RNG as well as the input. The same bytes could
|
|
88
|
+
parse two different ways, or succeed on one call and raise on the next.
|
|
89
|
+
It now samples evenly spaced lines, which is reproducible and, because it
|
|
90
|
+
always looks at the head and the tail, better evidence than a random
|
|
91
|
+
draw.
|
|
92
|
+
- A line the selected driver cannot parse no longer aborts the run. The
|
|
93
|
+
driver is chosen from a sample and then applied to every line, so one
|
|
94
|
+
stack trace in an application log, or one prose line in mixed tool
|
|
95
|
+
output, used to raise `ParseError` and lose the other four hundred
|
|
96
|
+
lines. It now falls back to `RawEntry` and reports `Analysis.degraded`.
|
|
97
|
+
Pass `strict=True` for the old behaviour.
|
|
98
|
+
- Samples are now the original lines, byte for byte. They were rebuilt
|
|
99
|
+
from parsed fields, which invented data: formats carrying no timestamp
|
|
100
|
+
were rendered with a placeholder `01 01 01:01:01 # #` envelope they
|
|
101
|
+
never had.
|
|
102
|
+
- `SecureLogHash` no longer mutates the log it is fingerprinting. `fill()`
|
|
103
|
+
assigned its generalised form back onto each entry, so hashing a secure
|
|
104
|
+
log destroyed it for every later reader — the user name and source
|
|
105
|
+
address, the only reason to read a sample, were gone. The rules now
|
|
106
|
+
build the key from a local copy.
|
|
107
|
+
|
|
108
|
+
### Fixed
|
|
109
|
+
- Fixed `select()` re-counting votes across rounds. One `Tally` was reused
|
|
110
|
+
while the sample list grew, so round three weighed the first ten lines
|
|
111
|
+
three times.
|
|
112
|
+
|
|
113
|
+
### Added
|
|
114
|
+
- Added `analyze_text()`, which returns the groups plus the driver used,
|
|
115
|
+
whether it degraded, and lines in versus lines grouped, so a caller can
|
|
116
|
+
account for every line rather than wonder where they went.
|
|
117
|
+
- Added a `driver=` argument to pin an entry class instead of detecting
|
|
118
|
+
one. A caller that must not have per-format vocabulary applied to its
|
|
119
|
+
payloads pins `RawEntry` and gets purely structural grouping. Unknown
|
|
120
|
+
names raise `PetitError`.
|
|
121
|
+
- Added a `stopwords=` argument taking regexes from the caller, used
|
|
122
|
+
instead of any packaged filter file. Normalisation policy belongs to
|
|
123
|
+
whoever reads the output: `hash.stopwords` is tuned for system logs and
|
|
124
|
+
deliberately aggressive, and its `[a-f]+#` rule collapses letters next
|
|
125
|
+
to a scrubbed number, so "bob0" and "boa0" group together. Right for
|
|
126
|
+
spotting a flapping daemon, wrong for a caller that needs two distinct
|
|
127
|
+
values to stay distinct.
|
|
128
|
+
- `stopwords=` entries may be `(regex, replacement)` pairs as well as bare
|
|
129
|
+
regexes, so a fingerprint can say what it normalised away: `<TS> host
|
|
130
|
+
sshd[<N>]: login from <IP>` rather than `# host sshd[#]: login from #`.
|
|
131
|
+
Patterns loaded from a file keep the `#` scrub character petit has
|
|
132
|
+
always used.
|
|
133
|
+
- Added `Group.sample_lines`, the 0-based position of each sample in the
|
|
134
|
+
input. Grouping throws the original order away, so a caller that wants
|
|
135
|
+
to show samples in written order rather than in group order had no way
|
|
136
|
+
back.
|
|
137
|
+
- `hash_text()` and `detect_format()` are unchanged for existing callers,
|
|
138
|
+
and the petit command line produces byte-identical output on the full
|
|
139
|
+
test corpus.
|
|
140
|
+
|
|
141
|
+
## [2.1.0] - 2026-09-18
|
|
142
|
+
|
|
143
|
+
### Added
|
|
144
|
+
- Added a library API: `crunchtools.hash_text()` and
|
|
145
|
+
`crunchtools.detect_format()`.
|
|
146
|
+
- Added `CrunchLog.from_text()` so callers can analyse a string without a
|
|
147
|
+
file.
|
|
148
|
+
- Packaged with `pyproject.toml` as the `crunchtools` distribution on
|
|
149
|
+
PyPI, with `petit` as a console script. The name "petit" on PyPI belongs
|
|
150
|
+
to an unrelated project.
|
|
151
|
+
|
|
152
|
+
### Fixed
|
|
153
|
+
- Fixed an infinite loop in `select()`: a buffer no driver claimed (blank
|
|
154
|
+
lines, for instance) spun forever and grew its sample list on every
|
|
155
|
+
pass. Bounded to `MAX_SELECT_ROUNDS` with a fall back to `RawEntry`.
|
|
156
|
+
- Fixed a missing comma in the fingerprint prefix list that joined two
|
|
157
|
+
paths into one, so `/opt` was never actually searched.
|
|
158
|
+
- Made 7 regex literals raw (`SyntaxWarning` today, `SyntaxError` on a
|
|
159
|
+
future Python) and escaped a literal `[` in a character class.
|
|
160
|
+
- Fixed #16: an unreadable or missing file escaped as a `PermissionError`
|
|
161
|
+
traceback. It now raises `DataFileError`, which the CLI reports as
|
|
162
|
+
`petit: cannot read <path>: Permission denied` and exits 1. Reported by
|
|
163
|
+
Pablo Iranzo Gomez in 2022.
|
|
164
|
+
- The petit command line is unchanged: `--hash`, `--daemon`, `--host` and
|
|
165
|
+
`--wordcount` all behave exactly as before.
|
|
166
|
+
|
|
167
|
+
### Removed
|
|
168
|
+
- Removed all 13 `sys.exit()` calls from library code; they raise
|
|
169
|
+
`PetitError` subclasses now, and only the CLI turns those into an exit
|
|
170
|
+
status.
|
|
171
|
+
- Removed `eval()` from the driver-detection path; `entry_types` holds the
|
|
172
|
+
classes rather than their names. Auto-registration of new drivers is
|
|
173
|
+
unchanged.
|
|
174
|
+
- Dropped the `sys.path` and `warnings.simplefilter` side effects from
|
|
175
|
+
package import; a library should not mutate global state when it is
|
|
176
|
+
imported.
|
|
177
|
+
|
|
178
|
+
### Changed
|
|
179
|
+
- Fingerprints and stopwords now ship inside the package and resolve
|
|
180
|
+
through `importlib.resources`, so a pip install has its data. They were
|
|
181
|
+
only ever installed to `/var/lib/petit` by the distro packaging, which
|
|
182
|
+
meant filtering silently did nothing anywhere else.
|
|
183
|
+
|
|
184
|
+
## [2.0.0] - 2022-10-13
|
|
185
|
+
|
|
186
|
+
### Changed
|
|
187
|
+
- Ported to Python 3.
|
|
188
|
+
- Cleaned up to PEP 8 and added the `Tally` class to simplify
|
|
189
|
+
driver-selection logic (committed 2011-04-16, the day after the 1.1.1
|
|
190
|
+
tag, so it waited here).
|
|
191
|
+
- Reorganised the directory structure.
|
|
192
|
+
- (Recorded retroactively in 2026 — this release shipped without a
|
|
193
|
+
changelog entry at the time.)
|
|
194
|
+
|
|
195
|
+
### Fixed
|
|
196
|
+
- Fixed Test 12; the suite passes again.
|
|
197
|
+
|
|
198
|
+
### Not merged during this period
|
|
199
|
+
Proposed but not merged, so none of it is in the code. Recorded because
|
|
200
|
+
the history is otherwise invisible; all four were opened by Pablo Iranzo
|
|
201
|
+
Gomez (iranzo) in Oct 2022 and closed unmerged in Nov 2024:
|
|
202
|
+
- #12 packaging for PyPI. Published independently as `petitlog` 2.0.0.post3
|
|
203
|
+
on 2022-10-17 — https://pypi.org/project/petitlog/ — which is why that
|
|
204
|
+
name is taken. It is this project, credited to Scott McCarty, and is
|
|
205
|
+
unrelated to the `crunchtools` distribution published in 2026.
|
|
206
|
+
- #14 GitHub Actions to help with release tagging.
|
|
207
|
+
- #15 pre-commit configuration, applied across the code.
|
|
208
|
+
- #17 permission check in CrunchLog.py to avoid a traceback on unreadable
|
|
209
|
+
files (closes #16).
|
|
210
|
+
|
|
211
|
+
## [1.1.1] - 2011-04-15
|
|
212
|
+
|
|
213
|
+
### Added
|
|
214
|
+
- Added `re.escape` to variable based regex.
|
|
215
|
+
- Added debugging output for graph.
|
|
216
|
+
- Added patch for bug with determining month.
|
|
217
|
+
- Added empty log data test, new test output for broken apache error log,
|
|
218
|
+
and new test files.
|
|
219
|
+
- Added path for logs with no data.
|
|
220
|
+
- Added try/catch for interspersed wrong data problem.
|
|
221
|
+
- Added better documentation for rsyslog.
|
|
222
|
+
|
|
223
|
+
### Fixed
|
|
224
|
+
- Fixed index bug in syslog entry and rsyslog.
|
|
225
|
+
|
|
226
|
+
### Changed
|
|
227
|
+
- Updated outputs for new patch and year change.
|
|
228
|
+
- Updated description of tests.
|
|
229
|
+
|
|
230
|
+
## [1.1.0] - 2010-11-09
|
|
231
|
+
|
|
232
|
+
### Changed
|
|
233
|
+
- Finished conversion of crunchtools to a module.
|
|
234
|
+
- Passes all tests again.
|
|
235
|
+
|
|
236
|
+
## [1.0.4] - 2010-11-08
|
|
237
|
+
|
|
238
|
+
### Fixed
|
|
239
|
+
- Updated version because of a problem with rpdb2.
|
|
240
|
+
|
|
241
|
+
## [1.0.3] - 2010-06-25
|
|
242
|
+
|
|
243
|
+
### Fixed
|
|
244
|
+
- Patched to allow mixed precision when Ubuntu 8.04 logs to an Ubuntu
|
|
245
|
+
10.04 server with high precision.
|
|
246
|
+
|
|
247
|
+
## Pre-1.0 history
|
|
248
|
+
|
|
249
|
+
These predate version numbering — the original changelog recorded them by
|
|
250
|
+
date only, with no corresponding git tag or release number. Dates are
|
|
251
|
+
preserved here rather than assigned invented version numbers.
|
|
252
|
+
|
|
253
|
+
### 2010-06-24
|
|
254
|
+
- Added support for rsyslogd precision time format.
|
|
255
|
+
- Added fingerprints for Ubuntu 10.04.
|
|
256
|
+
- Added NAME section to man page.
|
|
257
|
+
|
|
258
|
+
### 2010-02-27
|
|
259
|
+
- Added apache error log support and tests.
|
|
260
|
+
- Added man page.
|
|
261
|
+
- Added fingerprints for Ubuntu 9.04.
|
|
262
|
+
|
|
263
|
+
### 2010-02-12
|
|
264
|
+
- Moved a bunch of code into the `select` function of the Log object so
|
|
265
|
+
that it can now randomly sample ten entries over and over until it
|
|
266
|
+
determines what kind of file has been opened.
|
|
267
|
+
- Now passes all regression tests, all the time.
|
|
268
|
+
|
|
269
|
+
### 2010-01-18
|
|
270
|
+
- Changed defaults for entries to 1900 so that time delta calculations do
|
|
271
|
+
not fail.
|
|
272
|
+
- Changed log determination logic to use multiple samples.
|
|
273
|
+
- Fixed bug in SecureLog processing where sample line was not being
|
|
274
|
+
checked for long enough line.
|
|
275
|
+
- Added string conversion to all known log types to resolve type bugs
|
|
276
|
+
casting strings and numbers.
|
|
277
|
+
|
|
278
|
+
### 2010-01-15
|
|
279
|
+
- Added Linux secure log processing capabilities.
|
|
280
|
+
- Added month graph and year graph (syslog carries no year data, so
|
|
281
|
+
don't draw wrong conclusions from either).
|
|
282
|
+
- Added year support in code.
|
|
283
|
+
- Added Days graph.
|
|
284
|
+
- Added normalization code for better differentiation of close values,
|
|
285
|
+
handling most edge cases.
|
|
286
|
+
- Removed first sample, replaced by random sampling for log type
|
|
287
|
+
determination (later made deterministic in 2.2.0).
|
|
288
|
+
- Completely revamped date delta code using `datetime` built-in
|
|
289
|
+
functionality to calculate date/time ranges.
|
|
290
|
+
- Re-architected and redesigned graphing logic and output to better match
|
|
291
|
+
cacti/RRD. Kept graphing as separate classes per graph type rather than
|
|
292
|
+
a more "object-oriented" hierarchy — closer to report writing than
|
|
293
|
+
inheritance.
|
|
294
|
+
- Fixed documentation/help menu text.
|
|
295
|
+
- Fixed bug in value calculations of each bar of graph; values were
|
|
296
|
+
erroring low.
|
|
297
|
+
|
|
298
|
+
### 2009-07-31
|
|
299
|
+
- First working version.
|
|
300
|
+
|
|
301
|
+
[Unreleased]: https://github.com/crunchtools/petit/compare/v3.1.1...HEAD
|
|
302
|
+
[3.1.1]: https://github.com/crunchtools/petit/releases/tag/v3.1.1
|
|
303
|
+
[3.1.0]: https://github.com/crunchtools/petit/releases/tag/v3.1.0
|
|
304
|
+
[3.0.0]: https://github.com/crunchtools/petit/releases/tag/v3.0.0
|