---
title: "查询容器日志"
method: GET
path: "/namespaces/:namespace/pods/:pod/logs"
tags: ["Logs"]
---

# 查询容器日志

`GET /namespaces/:namespace/pods/:pod/logs`

## Request

- Base URL: `/bcsapi/v4/monitor/api/projects/:projectId/clusters/:clusterId` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/bcsapi/v4/monitor/api/projects/:projectId/clusters/:clusterId/namespaces/:namespace/pods/:pod/logs`
- Auth: none declared

## Query parameters

- `container_name` string, required
- `previous` string, required

## Response `200`

OK

- K8sclientLog[]
  - `log` string
  - `time` string

## Changes

- **2022-08-17** `6f5cef7b8940`: 2 info
  - api tag `Logs` added
  - api tag `Pod` removed
- **2022-05-18** `1e1b695c30e0`: 2 info
  - api tag `Pod` added
  - api tag `Logs` removed

[Operation history](https://skmtc.dev/tencentblueking/apis/bcs-monitor-openapi/changes/namespaces/:namespace/pods/:pod/logs/get.md)

---

[API](https://skmtc.dev/tencentblueking/apis/bcs-monitor-openapi.md) - [All operations](https://skmtc.dev/tencentblueking/apis/bcs-monitor-openapi/llms.txt) - [OpenAPI document](https://skmtc.dev/tencentblueking/apis/bcs-monitor-openapi/revisions/ba6addc245e8?raw)
