read_log
Tail large log files from the end and filter by keyword without loading the entire file. Ideal for syslog and nginx access logs.
Instructions
Safely read the end of a log file (tail), optionally filtering by a keyword (grep). Extremely efficient for huge log files as it reads backwards from the end without loading the whole file into memory. Use this instead of read_config for files like /var/log/syslog, nginx access logs, or any file that could be massive.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grep | No | Optional keyword to filter lines. Only lines containing this keyword (case-insensitive) will be returned. | |
| path | Yes | Absolute path to the log file (e.g. '/var/log/syslog', 'C:\logs\error.log'). | |
| lines | No | Number of lines to read from the end. Default is 100. Max is 1000. |