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, native engine, 3.41s

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; a default set (logfmt, serilog-clef, markdown, csv, jaccard) ships with logfold and logfold plugins lists, checks and installs more.

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 plugins check                                       # plugins you do not have yet; `install NAME` adds one
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.2.1

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.2.1
File Size Uploaded
logfold-0.2.1.tar.gz 106.9 kB Details

Built distributions (wheels)

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

Total release size: 7.7 MB

Release files / logfold-0.2.1.tar.gz

Download URL logfold-0.2.1.tar.gz
Size 106.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8b5659133e75b2fe0fff4214ddda866e9733ab6085a878be6c7dba04b56e0e50
BLAKE2b-256 checksum
How to use checksums
51365bf4b0c8c457f516ed164811ff5d8df959ffd9c7b1ca0c0b3e645220481f
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.2.1-cp310-abi3-win_amd64.whl

Download URL logfold-0.2.1-cp310-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2f143cf0f4b4b5f0d7d56194e45e10a84aeb0a258a5ff642ddcfd147d407ad96
BLAKE2b-256 checksum
How to use checksums
09aba47bb76929a755b7d1fdcda5235ee2099f38ab2d1d8875582bf1cbcee356
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.2.1-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL logfold-0.2.1-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
a77a00b2ee98536f217c1b40c57c76625830a7da682e89682b7a2854fa057b61
BLAKE2b-256 checksum
How to use checksums
3010a32f316e06419e06cfbf3706a4687b5023cb9d8ec1eb93b7bc7619530f80
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.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL logfold-0.2.1-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
cf0bc2a4ffe49827ae1361e2742553ce36db315208fcd1f29b8e63c1447e1974
BLAKE2b-256 checksum
How to use checksums
754833a749a14b04ad49aff72dd1c3da26e26f7d84da344446a39c9f73ea6884
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.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL logfold-0.2.1-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
05f68be49334e4e1b331fb223a992c905f0c48d4e05e76664c8ee0e25361618a
BLAKE2b-256 checksum
How to use checksums
03e978ab77685b5a7fa64039b71a6e00aa06c37d9e6cff9d4321b45860d3adc5
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.2.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL logfold-0.2.1-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
cf3c1eda163085a7b4eae2ec572f1b57e787d0ffa15af09ffda2432c78f92ccd
BLAKE2b-256 checksum
How to use checksums
da810fee52f09420bae39d5834c87113b11dabe0bcda7a1b281e9d0665d7d9d3
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.2.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL logfold-0.2.1-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
623ca02c4f482c62f0a5ec6ad2c97e8dde051dba6330740bdb789ee54220752c
BLAKE2b-256 checksum
How to use checksums
77e83a504baf4501523a53522ef2d9d49851d0bd7d8151c9b0678ad061668b11
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

This release

0.2.1 This release

7 release files

0.2.0

7 release files

0.1.0

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