wait_for_log_pattern
Blocks and streams remote logs (file or Docker) on single or multiple hosts until a regex pattern matches, helping verify events across nodes without polling.
Instructions
Blocks and streams a remote log file or Docker container logs on a single host ('host') or multiple hosts concurrently ('hosts') until a regex 'pattern' is matched or a timeout is reached. If using 'hosts', returns a JSON map of hostnames to success/error/timeout statuses containing the matched line. Extremely useful for verifying startup or events across cluster nodes without polling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | The target hostname or IP address | |
| hosts | No | A list of hostname targets to query concurrently | |
| pattern | Yes | Regex pattern to match | |
| container | No | The Docker container name or ID to stream (provide either file_path or container) | |
| file_path | No | Absolute path to log file on remote target (provide either file_path or container) | |
| timeout_secs | No | Maximum time to block (default: 60) |