Skip to main content
The pattern transform extracts recurring patterns from log messages using the Drain algorithm. A message like "User alice logged in from 10.0.0.1" becomes the pattern "User <*> logged in from <*>" — grouping thousands of similar messages into a handful of templates. Patterns are used by Tell’s anomaly detection to spot unusual log activity.

Quick start

That’s it. The defaults work well for most log volumes. Each log message gets a pattern ID attached, enabling pattern-based grouping and anomaly scoring downstream.

How it works

The Drain algorithm builds a tree of log patterns:
  1. Incoming messages are tokenized (split on whitespace)
  2. Tokens that look like variables — numbers, IPs, UUIDs, URLs, timestamps, paths, emails — are detected automatically
  3. Messages are matched against existing patterns by similarity
  4. If a match is found, the pattern’s count increments. If not, a new pattern is created.
The result is a set of templates like:

Similarity threshold

The similarity_threshold controls how aggressively messages are clustered:

Persistence

By default, patterns live in memory and are lost on restart. Enable file persistence to save them:
Patterns are saved in the background — persistence doesn’t slow down the transform pipeline.

Caching

The pattern matcher uses a 3-level cache for performance: Most messages hit L1 (identical to a recent message) and skip the tree entirely. The cache_size setting controls L1 capacity.

Reference

What’s next