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

Torch Log Service

Copy page
Download PDF
Data shipping API
CreateShipper
Copy page
Download PDF
CreateShipper
Call CreateShipper to create a delivery configuration.​
Request instructions​
  • Request method: POST​
  • Request URL: https://{tls-endpoint}/CreateShipper​
Request parameters​
The following table lists request parameters specific to this API and some common parameters. For more information, see Common parameters.​
Body​
​
Parameter​
Type​
Required​
Example value​
Description​
ContentInfo​
Object of ContentInfo​
Yes​
/​
Configuration for the delivery format of log content.​
KafkaShipperInfo​
Object of KafkaShipperInfo​
No​
/​
Configuration for delivering to Kafka.​
ShipperEndTime​
Integer​
No​
1723709712496​
Delivery end time, in milliseconds. If not set, delivery will continue indefinitely.​
tip​
When delivering to Kafka, it is recommended to configure the time range for delivery using the ShipperStartTime and ShipperEndTime fields, and leave the StartTime and EndTime fields empty.​
ShipperName​
String​
Yes​
tosship​
Delivery configuration name. For naming rules, see Resource Naming Rules. Unique within a project.​
ShipperStartTime​
Integer​
No​
1723709602496​
Delivery start time, in milliseconds timestamp. If not configured, the default is the current time.​
tip​
For delivery to Kafka, it is recommended to use the ShipperStartTime and ShipperEndTime fields to set the time range. Leave the StartTime and EndTime fields blank.​
ShipperType​
String​
Yes​
tos​
Delivery type.​
  • tos: Delivered to TOS.​
  • kafka: Delivered to Kafka.​
TopicId​
String​
Yes​
c7****​
ID of the log topic containing logs to be delivered.​
TosShipperInfo​
Object of TosShipperInfo​
No​
/​
Related settings for delivery to TOS object storage.​
RoleTrn​
String​
No​
trn:iam::2100000001:role/TLSETLAccessForUserA​
Custom role Trn.​
​
ContentInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Format​
String​
No​
json​
Log content parsing format.​
  • When delivering to TOS, supports json, jsonl and csv formats.​
  • When delivering to Kafka, supports original and json formats.​
CsvInfo​
Object of CsvInfo​
No​
/​
CSV format log content configuration.​
JsonInfo​
Object of JsonInfo​
No​
/​
Configure log content in JSON/JSONL format.​
​
KafkaShipperInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
EndTime​
Integer​
No​
1723709712496​
Delivery end time, in milliseconds. If not set, delivery will continue indefinitely.​
tip​
When sending to Kafka, use the ShipperStartTime and ShipperEndTime fields to specify the delivery time range, and leave the StartTime and EndTime fields empty.​
Compress​
String​
Yes​
snappy​
Compression format. Currently supports snappy, gzip, lz4, and none.​
Instance​
String​
Yes​
kafka-cnngbnntswg1****​
Kafka instance.​
StartTime​
Integer​
No​
1723709602496​
Delivery start time in milliseconds. If not configured, the current time is used by default.​
tip​
When delivering to Kafka, we recommend using the ShipperStartTime and ShipperEndTime fields to specify the delivery time range, and leaving the StartTime and EndTime fields empty.​
KafkaTopic​
String​
Yes​
topic-c​
Kafka Topic name All log data delivered through this configuration will be sent to the specified Topic​
​
TosShipperInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Bucket​
String​
Yes​
mytos​
Select a TOS bucket in the same region as the source log topic.​
  • Consist only of numbers, hyphens (-), and lowercase letters (a-z).​
  • Start and end with a number or letter.​
  • Length must be between 3 and 63 characters.​
Prefix​
String​
No​
testprefix​
Top-level directory name of the bucket. All log data delivered by this configuration will be stored in this directory.​
  • Cannot begin with a forward slash (/) or backslash (\), and consecutive forward slashes (/) are not allowed.​
  • Cannot begin with .. as a folder name.​
  • Folder names must be unique in the same bucket.​
MaxSize​
Integer​
No​
5​
The maximum size of the original file that can be delivered to each shard, referring to the uncompressed log file size. The unit is MiB, and the value range is 5 to 256.​
Compress​
String​
No​
snappy​
Compression format: currently supports snappy, gzip, lz4, and none.​
Interval​
Integer​
No​
300​
Delivery interval in seconds. Valid range: 300–900.​
PartitionFormat​
String​
No​
%Y/%m/%d/%H/%M​
Shard rules for log delivery.​
  • The subdirectory naming format supports strftime syntax and is set to %Y/%m/%d/%H/%M by default, for example: 2022/06/30/14/00.​
  • It cannot start with forward slashes ( / ) or backslashes ( \ ).​
​
CsvInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Keys​
Array of String​
Yes​
["user","log","ip"]​
Configure the fields to be delivered.​
  • Only letters, numbers, and _-./ are supported._Cannot start with.​
  • Within the same index, the key name must be unique.​
  • Length must be between 1 and 128 characters.​
Delimiter​
String​
Yes​
,​
Separator: supports commas, tabs, vertical bars, semicolons, and spaces.​
EscapeChar​
String​
Yes​
false​
Escape character: When a field contains a separator, use an escape character to enclose the field; currently, only single quotes, double quotes, and empty characters are supported.​
PrintHeader​
Boolean​
Yes​
false​
Print the key in the first row​
NonFieldContent​
String​
Yes​
test​
Invalid field fill content, length: 0–128​
​
JsonInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Keys​
Array of String​
No​
["__content", "__pod_name__"]​
When submitting in JSON/JSONL format, if this parameter is not set, all fields will be delivered, including __content__ (required), __source__, __path__, __time__, __image_name__, __container_name__, __pod_name__, __pod_uid__, namespace, __tag____client_ip__, and __tag____receive_time__.​
Enable​
Boolean​
Yes​
true​
Enable flag.​
Escape​
Boolean​
No​
true​
Enable escaping. Must be set to true.​
​
Return parameters​
The following table lists only the parameters specific to this API. For more information, see Return structure.​
​
Parameter​
Type​
Example value​
Description​
ShipperId​
String​
4a9bd4bd-53f1-43ff-b88a-64ee1be5****​
Delivery configuration ID.​
​
Sample request​
​
POST https://{tls-endpoint}/CreateShipper HTTP/1.1​
Content-Type: application/json​
{​
"ContentInfo": {​
"Format": "json",​
"JsonInfo": {​
"Enable": true​
}​
},​
"ShipperName": "test",​
"ShipperType": "tos",​
"TopicId": "a91c0d37-4c71-xxxx-b9cf-c0fae292d357",​
"TosShipperInfo": {​
"Bucket": "import-test",​
"Compress": "none",​
"Interval": 60,​
"MaxSize": 256,​
"PartitionFormat": "%Y",​
"Prefix": "test/"​
},​
"ShipperStartTime": 1719203400000,​
"ShipperEndTime": 1719204600000​
}​
​
Sample response​
​
{"ShipperId": "4a9bd4bd-53f1-43ff-b88a-64ee1be5****"}​
​
Error Code​
You can visit Public error codes to access more error code information.​
Last updated: 2026.02.03 17:43:46