You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Topic management API
ModifyTopic
Copy page
Download PDF
ModifyTopic
Call the ModifyTopic API to update log topic information.​
Usage instructions​
This API allows you to modify the log topic name, log retention period, and topic description. Changing the log topic ID is not supported. The request rate limit is 20 requests per second. Requests exceeding this limit will return the error ExceedQPSLimit.​
Request instructions​
  • Request method: PUT​
  • Request URL: https://{tls-endpoint}/ModifyTopic​
Request parameters​
The following table lists only the unique parameters for this API and some common parameters. For more information, see Public parameters.​
Body​
​
Parameter​
Type​
Required​
Example value​
Description​
TopicId​
String​
Yes​
0***********​
Log topic ID.​
TopicName​
String​
No​
test-topic​
Name of the log topic. Please refer to Resource Naming Rules for naming conventions.​
Ttl​
Integer​
No​
1300​
The total retention period of logs in TLS. When logs exceed the specified log storage period, expired logs in this log topic are automatically deleted. Unit: days. The default is 30 days. Value range: 1–3650. If you specify 3650 days, the data is stored permanently.​
tip​
After setting EnableHotTtl to true, the Ttl period must match the sum of HotTtl, ColdTtl, and ArchiveTtl.​
AutoSplit​
Boolean​
No​
true​
Automatic sharding can be enabled or disabled.​
  • true: When the volume of written data exceeds the existing shard capacity for five consecutive minutes, TLS will automatically split shards based on data volume to meet business needs, but the total number of shards after splitting cannot exceed the maximum limit. New shards created within the last 15 minutes will not split automatically.​
  • false: Automatic sharding is disabled.​
MaxSplitShard​
Integer​
No​
50​
Maximum number of shard splits, which refers to the maximum number of shards after splitting. The value range is 1 to 256, and the default value is 256.​
tip​
  • Required only when Automatic sharding is enabled, i.e., when AutoSplit is set to true.​
  • MaxSplitShard must be greater than the current number of shards; otherwise, TLS will not be able to split shards automatically.​
EnableTracking​
Boolean​
No​
false​
WebTracking can be enabled or disabled. If enabled, you can quickly collect frontend tracking data through it.​
  • true: Enables the WebTracking feature.​
  • false: Disables the WebTracking feature.​
tip​
After enabling WebTracking for a log topic, data written through the WebTracks API no longer requires authentication. This grants anonymous write access over the public network, which may result in dirty data. For details, see Collect logs by using WebTracking.​
Description​
String​
No​
This is a test topic.​
Description of the log topic.​
  • Does not support <>,'、\, \\, and all emoji symbols.​
  • Length: 0 to 64 characters.​
LogPublicIP​
Boolean​
No​
false​
Record extranet IP, can be enabled or disabled. By default, it is enabled. When enabled, TLS automatically adds the following metadata fields to the log content.​
  • __tag____client_ip__: the public IP address of the device where the log originates. When you use the private domain of TLS to write log data, the private IP address will be recorded.​
  • __tag____receive_time__: the time the log reaches the server, formatted as a 10-digit Unix timestamp.​
EnableHotTtl​
Boolean​
No​
false​
Enable tiered storage Once enabled, TLS supports standard storage, infrequent access storage, and archive storage.​
After setting HotTtl, ArchiveTtl, and ColdTtl, if the data retention time exceeds the corresponding value, the data will automatically move to infrequent access storage or archive storage until the total retention time (Ttl) is reached, when it is cleaned up by backend services.​
tip​
  • Archive storage is a beta feature. If you have relevant need, contact your account manager for allowlist access.​
  • Ttl duration must equal the sum of HotTtl, ColdTtl, and ArchiveTtl.​
HotTtl​
Integer​
No​
30​
Standard storage duration. The default duration is 30 days, with a range from 7 to 3650.​
This parameter only takes effect when EnableHotTtl is true.​
ColdTtl​
Integer​
No​
30​
Duration of infrequent access storage. The valid range for this duration is 1–3650.​
Enabling standard storage for 7 days or more allows infrequent access storage.​
This parameter only takes effect when EnableHotTtl is set to true.​
ArchiveTtl​
Integer​
No​
60​
Archive storage duration. The range is 60 to 3650 days.​
Archive storage is enabled when any of the following conditions are met.​
  • Standard storage duration is 30 days or longer.​
  • Standard storage duration is at least 7 days, and infrequent access storage duration is at least 30 days.​
This parameter is only effective when EnableHotTtl is set to true.​
​
Return parameters​
This API does not have specific return parameters. For more information, see Return structure.​
Sample request​
​
PUT https://{tls-endpoint}/ModifyTopic HTTP/1.1​
Content-Type: application/json​
{​
"TopicId": "66********",​
"TopicName": "test-topic",​
"Ttl": 30,​
"Description": "xxxxxx",​
"AutoSplit": true,​
"MaxSplitShard": 50,​
"EnableTracking": false​
}​
​
Sample response​
​
HTTP/1.1 200 OK​
Content-Type: application/json; charset=utf-8 ​
{}​
​
Error Code​
The table below lists error codes related to the business logic of this API. For public error codes, see the Public Error Codes documentation.​
​
HTTP status code​
Error Code​
Error message​
Description​
400​
InvalidArgument​
Invalid argument key %s, value %s, please check argument.​
Invalid parameter.​
404​
TopicNotExist​
topic %s does not exist.​
The log topic does not exist.​
409​
TopicAlreadyExist​
Topic %s already exist​
The log topic already exists.​
500​
InternalServerError​
We encountered an unexpected server error, please try again later.​
Internal server error.​
​
Last updated: 2025.10.28 18:41:13