portainer_container_logs_grep
Search container logs by regex to find specific errors, status codes, or keywords. Returns only matching lines, with optional context.
Instructions
Search container logs for lines matching a regex pattern.
Returns only matching lines (with optional context). Useful for finding specific errors, status codes, or keywords without downloading the full log.
Args: container_id: Container ID or name pattern: Regex pattern to search for (case-insensitive) tail: Number of log lines to fetch before filtering (default 500, max 1000) context_lines: Lines of context around each match (default 0, max 5) since: Only scan lines newer than this: a duration ("10m", "2h", "1d"), a Unix timestamp or an ISO-8601 datetime timestamps: Prefix every line with its timestamp (default false) endpoint_id: Target endpoint ID (uses default if omitted)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tail | No | ||
| since | No | ||
| pattern | Yes | ||
| timestamps | No | ||
| endpoint_id | No | ||
| container_id | Yes | ||
| context_lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |