Skip to main content

logfold

CI PyPI Python versions License: MIT Rust core

Fold large logs into templates, and see what changed between two runs. A Python library and command-line tool with a Rust core, for offline analysis of big log files: no platform to run, no data to upload.

$ logfold diff before.log after.log --out diff.html --fail-on-new
before.log -> after.log: 1,265,631 -> 1,246,573 records, 2 new (2 WARN+), 1 disappeared, 3 changed, 9 unchanged

New templates (2)
    before      after    change  level  template
         0     44,102       new  ERROR  circuit breaker opened for upstream <IP>
         0     44,310       new  WARN   queue depth <NUM> exceeds limit on worker-<NUM>
  • Templates. user alice failed login from 10.0.0.7 and a million siblings become one line user <*> failed login from <IP> with a count, first and last timestamp, severity and an example.
  • Diff. Compare two runs (before and after a deploy, passing and failing CI job). New, disappeared and changed templates, normalized by run size. Identical inputs produce an empty diff.
  • Fast. Rust core, streaming I/O with memory independent of the file size, deterministic multi-threaded mining. See benchmarks.
  • A Python library first. analyze() and diff() return plain, immutable dataclasses; reports are JSON (versioned schema), self-contained HTML or text.
  • Extensible. Formats, reporters and diff matchers are plugins discovered through entry points.

Install

pip install "logfold[cli]"

Wheels are published for Linux, macOS and Windows (Python 3.10+), so nothing is compiled on your machine.

Use

from logfold import analyze, diff

result = analyze("app.log")  # format auto-detected
for template in result.top(10):
    print(template.count, template.level, template.text)
result.to_html("report.html")

comparison = diff("before.log", "after.log")
comparison.new_templates
comparison.new_alerts  # new WARN/ERROR/FATAL templates
comparison.to_html("diff.html")
logfold analyze app.log --top 30 --out report.html          # fold one run into templates
logfold diff before.log after.log --fail-on-new-alerts      # exit code 2 in CI when something new is wrong
logfold formats                                             # list the log formats
logfold info                                                # versions and engine availability, for bug reports
logfold --version

Documentation

How it relates to other tools

logfold Drain3 logdrain logdelta
Language Rust core, Python API + CLI Python Rust Rust
Template quality identical to Drain3 on Loghub-2k reference Drain Drain-based
Compare two runs yes (diff, shares normalized, recount) no no (online "template created" signal) yes (diff, several baselines, blocks)
Python API yes yes no no
Multi-threaded mining of one big file yes, deterministic no not documented for the CLI (library add is thread-safe) not documented
Reports JSON, HTML, text - text, JSON, CSV terminal, JSON, Markdown

Timings are in bench/RESULTS.md, measured with the protocol that was fixed before the runs. Template quality: python eval/quality.py (grouping accuracy on the 16 Loghub-2k datasets).

Design

Layered: a pure domain core (masking, tokenizer, Drain-compatible tree, merge) with no I/O, adapters for files and formats, an execution layer, a thin PyO3 shim, and a Python package on top. The algorithm is specified in docs/ALGORITHM.md; a pure-Python reference engine implements the same specification, and the Rust engine is tested against it for exact equality.

Development

See CONTRIBUTING.md (branches, commits, issues, definition of done).

License

MIT, see LICENSE. Copyright (c) 2026 Andrey Kilanov.

Metadata

Release files for logfold 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for logfold 0.1.0
File Size Uploaded
logfold-0.1.0.tar.gz 92.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for logfold 0.1.0
File
logfold-0.1.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
logfold-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
logfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
logfold-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
logfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
logfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 7.6 MB

Release files / logfold-0.1.0.tar.gz

Download URL logfold-0.1.0.tar.gz
Size 92.5 kB
Tags Source
SHA-256 checksum
How to use checksums
db01fd41c4d60aca6b725150a5d5fd55ad854567174a340916655e7fefe2a416
BLAKE2b-256 checksum
How to use checksums
33242274c87f9275a42568ef198848e576c3fd011fd5a9cf49806d86f14a5cda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / logfold-0.1.0-cp310-abi3-win_amd64.whl

Download URL logfold-0.1.0-cp310-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
26d4232c90510fb899877b131c8d6fa77fea337a02afa28c00700c49deb80243
BLAKE2b-256 checksum
How to use checksums
ee2eb915cce2b5ec780fdbe421c78da7895c196aa67658cc43ae2b2eddea7d2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / logfold-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL logfold-0.1.0-cp310-abi3-musllinux_1_2_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
c22e659347011e0b9021b05d140fc5a8d9c9a3e72bac80602afb1675e9589be1
BLAKE2b-256 checksum
How to use checksums
4ccf09a298d492b43f4c7f9bcd23f0ca023320edb7ace3134e234509b971c772
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / logfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL logfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7af1d271083eb832a67e04a3e5f25d863ee873c1b3f1ce3b535eebd40f605f2c
BLAKE2b-256 checksum
How to use checksums
f7c77555742020ce1bdc0d44a94e2806d8b3220a901de14a9c37686dc679ef2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / logfold-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL logfold-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
c6d8915a30d33d61c02dd81a62a316a48c5625cdffaee599338413e06a43bcc5
BLAKE2b-256 checksum
How to use checksums
f5cde52dfa802d2b2f6b74952a18f20d1a2f031b5eaa8ba70c4c174a18d490ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / logfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL logfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Size 1.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9cacf18eb339660a4d1137f5450e2474479887c2cd0290a0cd95095d43c9cece
BLAKE2b-256 checksum
How to use checksums
92918d57567df119ceb398ce375f96dc55764ce35251f51caf1e572f31c67b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / logfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL logfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ab1b53f3a6fb40af85ea731c414941d8458c91c94dc330ecc978ed5bc13f9989
BLAKE2b-256 checksum
How to use checksums
b207a237a874249576f163d31588c0d6bd5c8f0289b0c64e6f229618a35c5c14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

7 release files

0.4.0

7 release files

0.3.0

7 release files

0.2.1

7 release files

0.2.0

7 release files

This release

0.1.0 This release

7 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page