百度智能云

All Product Document

          Log Service

          DescribeLogStoreTemplate

          Description

          Get logstore template details

          Request

          • Request syntax
          POST /v3/bls?action=DescribeLogStoreTemplate HTTP/1.1
          Host: <Endpoint>
          Authorization: <Authorization String>
          Content-Type: application/json; charset=utf-8
          {
            "name": <name>,
          }
          • 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
          POST /v3/bls?action=DescribeLogStoreTemplate HTTP/1.1
          Host: bls-log.bj.baidubce.com
          Authorization:bce-auth-v1/18717522d39411e9b721df098b0b908c/2019-09-10T07:00:20Z/1800/content-type;host;x-bce-date;x-bce-request-id/6a7cb6c9ac7ec156c805e55e7d0bcfc443b47feee97cf099c1c0d93a0b4c8304
          Content-Type: application/json; charset=utf-8
          {
              // Template name: Required
              "name": "my-template"
          }
          • Response example
          HTTP/1.1 201
          Content-Type: application/json; charset=utf-8
          X-Bce-Request-Id: 2eeba101-4cc7-4cfe-b5ac-a3be8d060e33
          Date: Fri, 10 Apr 2020 04:42:37 GMT
          {
              "success": true,
              "code": "OK",  // Error code
              "message": "",  // Error details    
              
              "name": "my-template",  // Template name    
              "projectPatterns": ["my-project-*"],  // Log group matching pattern    
              "logstorePatterns": ["my-logstore-*"],  // Logstore matching pattern    
              "priority": 10,  // Logstore template priority
              "createdTimestamp": "2025-04-20T10:01:12Z",  // Creation time (UTC)
              "updatedTimestamp": "2025-04-21T10:01:12Z",  // Update time (UTC)
                      
              // Template configuration  
              "template": {        
                  "retention": 1,  // Retention period (unit: days)        
                  "shardCount": 1,  // Initial number of shards
                  "disableShardAutoSplit": false,  // Whether to disable automatic shard splitting
                  "maxShardCount": 50,  // Maximum number of splits
                  "enableHotRetention": false,  // Whether to enable automatic hot-cold tiering        
                  "hotRetention": 7,  // Hot storage retention period (unit: days) when hot-cold tiering is enabled
                  // Index configuration
                  "index": {  
                      "fulltext": true,        // Whether to enable full-text index           
                      "caseSensitive": false,  // Case sensitivity for full-text index
                      "separators": "@&?|#()='\",;:<>[]{}/ \n\t\r\\",  // Tokenizer separator for full-text index
                      "includeChinese": false, // Whether full-text index includes Chinese            
                      // Field index list
                      "fields": {
                          "level": {                     
                              "type": "string",  // Field type: Optional values: bool, long, text, float, json
                              "caseSensitive": false,  // Case sensitivity
                              "separators": "@&?|#()='\",;:<>[]{}/ \n\t\r\\",  // Tokenizer separator for index
                              "includeChinese": false,  // Whether to include Chinese
                              "dynamicMapping": false,  // Whether to enable dynamic indexing
                          },
                      }
                  }
              }
          }
          Previous
          DeleteLogStoreTemplates
          Next
          DescribeLogStoreTemplates