extract_python_tracebacks
Extracts complete Python tracebacks from log text, files, or URLs using heuristics and truncates each to a set length, optionally adding surrounding context.
Instructions
Extract Python tracebacks using specialized heuristic.
Analyzes log text and extracts unbroken Python tracebacks.
Traces are truncated to `max_traceback_len` characters.
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_traceback_len: Maximum character length per extracted traceback.
skip_patterns: Optional list of regex patterns.
Chunks matching any pattern are excluded.
context: Number of lines to include before and after each traceback (0-50).
These lines are additional to max_traceback_len. A truncated
traceback keeps its shortened text; following context begins after
the original traceback ends.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Number of surrounding lines to include. | |
| log_url | No | ||
| log_path | No | ||
| log_text | No | ||
| skip_patterns | No | ||
| max_traceback_len | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |