search_log_keyword
Search log files by keyword or regex to locate events and return matching lines with surrounding context for diagnosis.
Instructions
在日志中按关键词或正则表达式搜索,返回命中行及其上下文。
Args: file_path: 日志文件绝对路径。 keyword: 关键词;regex 为 True 时视为正则表达式。 regex: 是否按正则匹配,默认 False(普通子串匹配)。 context: 每个命中前后展示的上下文行数,默认 2。 max_results: 最多返回的命中组数,默认 50。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regex | No | ||
| context | No | ||
| keyword | Yes | ||
| file_path | Yes | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |