DescribeLogStoreTemplate
Updated at:2025-11-03
Description
Get logstore template details
Request
- Request syntax
Text
1POST /v3/bls?action=DescribeLogStoreTemplate HTTP/1.1
2Host: <Endpoint>
3Authorization: <Authorization String>
4Content-Type: application/json; charset=utf-8
5{
6 "name": <name>,
7}
- Request headers
No additional headers are required beyond the standard request headers.
- Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| name | String | Yes | RequestBody | Template name |
Response
- Response headers
No additional headers are required beyond the standard response headers.
- Response parameters
| Field | Types | Description |
|---|---|---|
| success | Boolean | Whether the request succeeded |
| code | String | Request code, OK for success, or a specific error code for failure |
| message | String | Empty for request success, or a specific error message for request failure |
| name | String | Template name: Unique under the same user |
| projectPatterns | List<String> | Log group matching pattern: Supports * wildcard |
| logstorePatterns | List<String> | Logstore matching pattern: Supports * wildcard |
| priority | Int | Logstore template priority: Higher values indicate higher priority; unique under the same user |
| createdTimestamp | String | Creation time (UTC), Format: 2025-04-20T10:01:12Z |
| updatedTimestamp | String | Update time (UTC), Format: 2025-04-20T10:01:12Z |
| template | Template | Template configuration |
The element structure of Template object is as follows:
| Parameter name | Types | Description |
|---|---|---|
| retention | Int | Logstore retention period: Unit is days |
| shardCount | Int | Initial number of shards for the logstore |
| disableShardAutoSplit | Boolean | Whether to disable automatic shard splitting: If automatic splitting is enabled, BLS will automatically expand shards based on the log write traffic of the logstore. Optional; default value: false |
| maxShardCount | Int | If automatic shard splitting is enabled, this field is required. Enter the maximum number of splits; value range: [1 to 50] |
| enableHotRetention | Boolean | Whether to enable automatic hot-cold tiering: Optional; default value: false |
| hotRetention | Int | If hot-cold tiering is enabled, this field is required. Enter the hot storage retention period (unit: days); 7 <= hotRetention <= retention |
| index | Object | Index configuration: Refer to Create Index API |
Error code
No special error codes apart from standard error codes
Example
- Request example
Text
1POST /v3/bls?action=DescribeLogStoreTemplate HTTP/1.1
2Host: bls-log.bj.baidubce.com
3Authorization:bce-auth-v1/18717522d39411e9b721df098b0b908c/2019-09-10T07:00:20Z/1800/content-type;host;x-bce-date;x-bce-request-id/6a7cb6c9ac7ec156c805e55e7d0bcfc443b47feee97cf099c1c0d93a0b4c8304
4Content-Type: application/json; charset=utf-8
5{
6 // Template name: Required
7 "name": "my-template"
8}
- Response example
Text
1HTTP/1.1 201
2Content-Type: application/json; charset=utf-8
3X-Bce-Request-Id: 2eeba101-4cc7-4cfe-b5ac-a3be8d060e33
4Date: Fri, 10 Apr 2020 04:42:37 GMT
5{
6 "success": true,
7 "code": "OK", // Error code
8 "message": "", // Error details
9
10 "name": "my-template", // Template name
11 "projectPatterns": ["my-project-*"], // Log group matching pattern
12 "logstorePatterns": ["my-logstore-*"], // Logstore matching pattern
13 "priority": 10, // Logstore template priority
14 "createdTimestamp": "2025-04-20T10:01:12Z", // Creation time (UTC)
15 "updatedTimestamp": "2025-04-21T10:01:12Z", // Update time (UTC)
16
17 // Template configuration
18 "template": {
19 "retention": 1, // Retention period (unit: days)
20 "shardCount": 1, // Initial number of shards
21 "disableShardAutoSplit": false, // Whether to disable automatic shard splitting
22 "maxShardCount": 50, // Maximum number of splits
23 "enableHotRetention": false, // Whether to enable automatic hot-cold tiering
24 "hotRetention": 7, // Hot storage retention period (unit: days) when hot-cold tiering is enabled
25 // Index configuration
26 "index": {
27 "fulltext": true, // Whether to enable full-text index
28 "caseSensitive": false, // Case sensitivity for full-text index
29 "separators": "@&?|#()='\",;:<>[]{}/ \n\t\r\\", // Tokenizer separator for full-text index
30 "includeChinese": false, // Whether full-text index includes Chinese
31 // Field index list
32 "fields": {
33 "level": {
34 "type": "string", // Field type: Optional values: bool, long, text, float, json
35 "caseSensitive": false, // Case sensitivity
36 "separators": "@&?|#()='\",;:<>[]{}/ \n\t\r\\", // Tokenizer separator for index
37 "includeChinese": false, // Whether to include Chinese
38 "dynamicMapping": false, // Whether to enable dynamic indexing
39 },
40 }
41 }
42 }
43}
