search_log_file
Search a log file using regex patterns, returning matching lines with surrounding context. Supports token-based pagination to fit AI constraints.
Instructions
Searches a log file using regex pattern and returns matching lines with surrounding context. Supports token-based pagination to respect AI context limits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | Regex pattern to search for | |
| filename | Yes | Name of the log file to search | |
| max_tokens | No | Maximum tokens to return (default: 4000, max: 100000). Uses ~4 chars per token estimation. When specified, overrides max_matches. | |
| max_matches | No | DEPRECATED: Use max_tokens instead. Maximum number of matches to return (max: 500). If specified, overrides max_tokens. | |
| skip_matches | No | Number of matches to skip (for pagination, default: 0) | |
| context_after | No | Number of lines to show after each match (max: 10). Overrides context_lines for after-context. | |
| context_lines | No | Number of lines to show before and after each match (default: 2, max: 10). Overridden by context_before/context_after if specified. | |
| case_sensitive | No | Whether the search should be case-sensitive (default: false) | |
| context_before | No | Number of lines to show before each match (max: 10). Overrides context_lines for before-context. |