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

Torch Log Service

Copy page
Download PDF
Data shipping API
ModifyShipper
Copy page
Download PDF
ModifyShipper
Call the ModifyShipper API to update the specified delivery configuration.​
Request instructions​
  • Request method: PUT​
  • Request URL: https://{tls-endpoint}/ModifyShipper​
Request parameters​
The table below lists only the 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​
No​
/​
Log content delivery format configuration.​
KafkaShipperInfo​
Object of KafkaShipperInfo​
No​
/​
Kafka delivery configuration.​
ShipperId​
String​
Yes​
4a9bd4bd-53f1-43ff-b88a-64ee1be5****​
Delivery configuration ID.​
ShipperName​
String​
No​
test​
Delivery configuration name. For naming rules, see Resource Naming Rules. Unique within a project.​
ShipperType​
String​
No​
tos​
Type of data source for delivery. Optional values:​
  • tos: Deliver to TOS.​
  • If not configured, the default is TOS​
  • kafka: Deliver to Kafka​
Status​
Boolean​
No​
true​
Enable the delivery configuration. The default value is true.​
TosShipperInfo​
Object of TosShipperInfo​
No​
/​
Information related to delivery to TOS object storage.​
RoleTrn​
String​
No​
trn:iam::2100000001:role/TLSETLAccessForUserA​
Trn for custom roles.​
​
ContentInfo​
​
Parameters​
Type​
Required​
Example value​
Description​
Format​
String​
No​
json​
Log content parsing format.​
  • When delivering to TOS, you can configure json, jsonl or csv.​
  • When delivering to Kafka, you can configure original or json.​
CsvInfo​
Object of CsvInfo​
No​
/​
Configuration for CSV-format log content.​
JsonInfo​
Object of JsonInfo​
No​
/​
JSON/JSONL format log content configuration.​
​
KafkaShipperInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Compress​
String​
Yes​
snappy​
Compression format; currently supports snappy, gzip, lz4, and none.​
Instance​
String​
Yes​
kafka-cnngbnntswg1****​
Kafka instance.​
KafkaTopic​
String​
Yes​
topic-c​
Kafka Topic name. All log data delivered using this configuration will be sent to this Topic.​
​
TosShipperInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Prefix​
String​
No​
testprefix​
Top-level directory name for the bucket. All log data delivered through this configuration will be stored in this directory.​
  • Cannot start with a forward slash (/) or backslash (\), and consecutive forward slashes (/) are not allowed.​
  • Cannot use .. as a folder name.​
  • Folder names must be unique in the same bucket.​
MaxSize​
Integer​
No​
5​
The maximum size of raw files that can be delivered in each shard, which refers to the uncompressed log file size. The unit is MiB. Accepted values range from 5 to 256.​
Compress​
String​
No​
snappy​
Compression formats: Currently supports snappy, gzip, lz4, and none.​
Interval​
Integer​
No​
300​
Delivery interval in seconds; valid range is 300–900.​
PartitionFormat​
String​
No​
%Y/%m/%d/%H/%M​
Shard rules for log delivery.​
  • Subdirectory naming supports strftime syntax. The default is %Y/%m/%d/%H/%M, 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; not supported to start with_the following.​
  • Within the same index, the key name must be unique.​
  • Length must be between 1 and 128 characters.​
Delimiter​
String​
Yes​
,​
Separator. You can use a comma, tab, vertical bar, semicolon, or space.​
EscapeChar​
String​
Yes​
false​
Escape character: When a field contains a separator, use an escape character to enclose the field. 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​
Content for invalid fields; length must be between 0 and 128 characters.​
​
JsonInfo​
​
Parameter​
Type​
Required​
Example value​
Description​
Keys​
Array of String​
No​
["__content", "__pod_name__"]​
When delivering in JSON/JSONL format, if this parameter is not configured, all fields are 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​
Escape characters. This must be set to true.​
​
Return parameters​
This API does not have unique return parameters. For more information, see Return structure.​
Sample request​
​
PUT https://{tls-endpoint}/ModifyShipper HTTP/1.1​
Content-Type: application/json​
{​
"ShipperId": "6e948fca-d3e*****0b-b5cca0b29383",​
"ContentInfo": {​
"Format": "json",​
"JsonInfo": {​
"Enable": true​
}​
},​
"ShipperName": "tosTimeTest-1",​
"ShipperType": "tos",​
"TosShipperInfo": {​
"Bucket": "tos-import-logs",​
"Compress": "snappy",​
"Interval": 60,​
"MaxSize": 256,​
"PartitionFormat": "%Y",​
"Prefix": "timeTest"​
},​
"ShipperStartTime": 1725012764000,​
"ShipperEndTime": 1723795560000​
}​
​
Sample response​
​
HTTP/1.1 200 OK​
Content-Type: application/json; charset=utf-8​
​
{}​
​
Error Code​
You can visit Public Error Codes for more information about error codes.​
Last updated: 2026.02.03 17:43:46