"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
How it works
The Drain algorithm builds a tree of log patterns:- Incoming messages are tokenized (split on whitespace)
- Tokens that look like variables — numbers, IPs, UUIDs, URLs, timestamps, paths, emails — are detected automatically
- Messages are matched against existing patterns by similarity
- If a match is found, the pattern’s count increments. If not, a new pattern is created.
Similarity threshold
Thesimilarity_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: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
- Anomaly Detection — how patterns power log anomaly scoring
- Logs — structured logging reference