Description
Drain3 is an online log template miner for Python. It extracts templates, or clusters, from a stream of log messages as they arrive, and it keeps learning as it goes. It uses a fixed-depth parse tree to guide the search for log groups, which avoids building a very deep and unbalanced tree. The project is an upgrade of the original Drain by LogPAI, moved from Python 2.7 to Python 3.6 or later, with extra features and bug fixes. Drain3 can save and load its state to an Apache Kafka topic, to Redis, or to a file. It supports streaming, so you can feed it messages one at a time. Its masking feature replaces parts of messages, such as numbers, IP addresses or emails, with wildcards, which the README says improves the accuracy of template mining. Configuration is supported, and the library is packaged for pip. The README shows an example of input log lines and the templates Drain3 extracts from them, and it links a blog post about using Drain3 to monitor for network outages. The project now lives in the logpai GitHub organization, which is also home to the original Drain implementation, and the maintainers welcome more contributors. It is open source on GitHub.…
Highlights
- Online log template mining from streams
- Fixed-depth parse tree
- Persistence to Kafka, Redis or a file
- Masking of numbers, IPs and emails
- Packaged for pip
Ratings & Reviews
No ratings yet
Be the first to rate Drain3.
People also visit
Drain3 FAQ
What is Drain3?
An online log template miner for Python that extracts templates from a stream of log messages.
How is it different from the original Drain?
The README says Drain3 upgrades the original Drain project from Python 2.7 to Python 3.6 or later, with extra features and bug fixes.
Where can it store its state?
In an Apache Kafka topic, in Redis, or in a file.
What is masking?
It replaces parts of messages, such as numbers, IP addresses and emails, with wildcards, which improves template accuracy.
How do I install it?
It is packaged as a pip package, and the README includes configuration options.
What are the best Drain3 alternatives?
Popular alternatives to Drain3 include Random Cut Forest By Aws. See all Drain3 alternatives





