extract_log_snippets
Analyze large logs by clustering messages with Drain3 and return representative snippets from text, files, URLs, or compressed archives for faster troubleshooting.
Instructions
Extract representative log snippets using Drain3 clustering.
Analyzes log text by chunking it into logical messages, clustering
similar messages using the Drain algorithm, and returning one
representative snippet per cluster.
Exactly one of log_text, log_path, or log_url must be provided.
Downloaded inputs are limited to 100 MB.
Compressed files (.gz, .bz2, .xz, .zip, .tar, .tar.gz, .tar.bz2,
.tar.xz) are decompressed transparently. Archives must contain
exactly one file. Compression ratios above 100:1 are rejected.
Args:
log_text: Raw log text to analyze.
log_path: Path to a log file on disk.
log_url: HTTP(S) URL to fetch log content from.
max_clusters: Maximum number of clusters/snippets to extract.
max_snippet_len: Maximum character length per snippet chunk.
skip_patterns: Optional list of regex patterns.
Chunks matching any pattern are excluded before clustering.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log_url | No | ||
| log_path | No | ||
| log_text | No | ||
| max_clusters | No | ||
| skip_patterns | No | ||
| max_snippet_len | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |