Skip to main content

Crate logdrain

Crate logdrain 

Source
Expand description

logdrain — online log-template mining.

An independent Rust implementation of the Drain algorithm (He et al., 2017), with the practical extensions Drain3 popularized (masking, persistence, numeric parametrization). Feed log lines to a Miner and it clusters them into templates online, returning a cluster id per line.

Modules§

builtin_masks
Built-in masks for common high-cardinality tokens.

Structs§

AddResult
Result of Miner::add.
Cluster
Immutable snapshot of a cluster, returned by miner query APIs.
FilePersistence
File backend with crash-safe writes: data is written to a temporary sibling file, fsynced, then atomically renamed over the target.
Mask
A single pre-tokenization mask: a regex whose matches are replaced by a named placeholder.
MemoryPersistence
In-memory backend. Useful for tests and ephemeral processes.
Miner
Thread-safe online log-template miner.
MinerBuilder
Fluent builder for Options / crate::Miner.
Options
Resolved, validated miner configuration. Immutable for a miner’s lifetime.
OwnedToken
Owned token stored inside a crate::Cluster.
Token
A borrowed token: a slice of the input line plus path-delimiter flags.

Enums§

LogdrainError
Errors returned by logdrain. v0.1 subset; persistence/regex variants land in later phases.
PersistenceError
Error from a persistence backend.
UpdateType
How an add affected the matched/created cluster.

Traits§

Persistence
A place to store and retrieve a serialized miner snapshot.

Type Aliases§

ClusterId
Stable, process-unique identifier for a cluster.