Kubectl logs
kube_logsRetrieve Kubernetes pod logs as timestamped lines, keep newest output under budget, merge repeated messages, and filter by regex with grep instead of shell piping.
Instructions
Get pod logs. lines are as kubectl prints them, ' ', oldest first; consecutive repeats of a message merge into the first, marked ' [×N]', and a budget cut keeps the newest. Use grep to filter lines by regex pattern (e.g. 'ERROR|WARN') instead of piping through shell commands.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pod | No | Required. Pod name (or deployment/xxx) | |
| grep | No | Regex pattern to filter log lines (e.g. 'ERROR|WARN', 'timeout'). Only matching lines are returned. | |
| tail | No | Number of lines (default 100) | |
| since | No | Duration like '1h', '30m' | |
| context | No | Kube context | |
| maxItems | No | Item cap; overrides detailLevel | |
| container | No | Container name | |
| namespace | No | Namespace | default |
| ignoreCase | No | Case-insensitive grep matching (default: false) | |
| includeRaw | No | Include raw/verbose fields | |
| detailLevel | No | Item preset: summary 20, normal 100, full (default; also skips the response budget) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | ||
| total | No | ||
| retained | No | ||
| truncated | No |