# Retrieve Cluster Node Logs - GetUMongoDBLog

## Overview

Query error logs or slow query logs of cluster nodes within a specific time period






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `GetUMongoDBLog`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.dezai.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [Region and Availability Zone List](/docs/api/summary/regionlist) |**Yes**|
| **Zone** | string | Availability Zone. See [Availability Zone List](/docs/api/summary/regionlist) |No|
| **ProjectId** | string | Project ID. Leave blank for the default project; sub-accounts must fill this in. Please refer to [GetProjectList API](/docs/api/summary/get_project_list) |No|
| **ClusterId** | string | Cluster ID |**Yes**|
| **NodeId** | string | Node ID, slow log mongos node not selectable |**Yes**|
| **Begin** | int | The timestamp (Unix Timestamp) when the queried log starts. For real-time queries, this parameter should be the timestamp from the last polling request, and the backend will return the log content from this value to the current time. |**Yes**|
| **LogType** | string | Log Type: SlowLog, ErrorLog |**Yes**|
| **End** | int | The end timestamp (Unix Timestamp) for querying logs. For real-time queries, this value is not passed, and the difference with BeginTime should not exceed 24 hours: (EndTime-BeginTime) < 24*60*60 |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **Log** | string | The retrieved log content, a segment of plain text |**Yes**|
| **MaxLine** | int | Maximum Supported Rows |No|
| **IsTruncate** | boolean | Has it been truncated |No|




## Example

### Request Example
    
```
https://api.dezai.com/?Action=GetUMongoDBLog
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=RNIPzEei
&NodeId=lWaoAKsr
&Begin=4
&LogType=cSfGujbe
&End=6
&ClusterId=ZTYDWNOp
```

### Response Example
    
```json
{
  "Action": "GetUMongoDBLogResponse",
  "IsTruncate": true,
  "Log": "nZKlllSk",
  "MaxLine": 1,
  "NextTime": "auUFaISM",
  "RetCode": 0
}
```





