Get Logs
get_logsRetrieve logs from Kubernetes pods, deployments, jobs, or resources filtered by label selector, with options for container selection, line count, time range, and timestamps.
Instructions
Get logs from pods, deployments, jobs, or resources matching a label selector
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource_type | Yes | Type of resource to get logs from ('pod', 'deployment', 'job', etc.) | |
| namespace | No | The Kubernetes namespace. If not provided and name is specified, uses the 'default' namespace. If neither name nor namespace is provided, searches across all namespaces. | |
| name | No | The name of the specific resource to get logs from. | |
| label_selector | No | Label selector to filter resources (e.g. 'app=nginx'). Required if name is not provided. | |
| container | No | The container name within the pod. If not specified and the pod has multiple containers, logs from the first container will be returned. | |
| tail | No | Number of lines to show from the end of the logs. | |
| since_seconds | No | Return logs newer than a relative duration in seconds. | |
| timestamps | No | Include timestamps at the beginning of each line. Default is False. |