Create Log Shipper
Updated at:2025-11-03
Description
To create logshippers for specific logstores, the following guidelines shall be complied with:
- More than one logshipper can be created per logstore, and the total logshippers are not more than 300
- Logshipper name, at most 63 characters, including letters, digits, - and _
- The delivery start time can be set to a minimum of 180 days in the past or a maximum of 24 hours in the future. By default, the task creation time is used as the start time. The format must meet ISO 8601.
Request
- Request syntax
Http
1POST /v1/logshipper HTTP/1.1
2Host: bls-log.{region}.baidubce.com
3Authorization: authorization string
- Request headers
No additional headers are required beyond the standard request headers.
- Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| project | string | no | body | Project name, default |
| logStoreName | string | yes | body | Logstore name |
| logShipperName | string | yes | body | Logshipper name |
| startTime | string | no | body | Delivery start time |
| destType | string | no | body | The delivery destination location type currently supports BOS only |
| destConfig | DestConfig | yes | body | Target configuration details |
DestConfig structure:
| Parameter name | Types |
Required or not | Description |
|---|---|---|---|
| BOSPath | string | yes | BOSPath consists of a bucket plus a user-defined path, at most 256 characters |
| partitionFormatTS | string | no | Disk partition format, such as %Y/%m/%d/%H/%M/, support minute-level precision only, can be customized or empty; default: %Y/%m/%d/%H/%M/ |
| partitionFormatLogStream | bool | no | Whether to use logstream as a partition level; default: false |
| maxObjectSize | int64 | no | Maximum object size, in MB, range: 1~ 5*1024*1024 (5TB); default: 64. |
| compressType | string | no | Compression type, optional parameters: snappy/gzip/bzip2/lzop and none; default: none |
| deliverInterval | int | no | Delivery interval, in minute, limit range: integers between 5 and 60; default: 5 |
| storageFormat | string | no | Storage format, optional parameters: parquet, json, csv; default: json |
| csvHeadline | bool | no | Whether to deliver the field name in case of CSV; default: false (not deliver) |
| csvDelimiter | string | no | Separator in case of CSV, options: comma (,), space ( ), pipe (|), or tab (\t); default: comma |
| csvQuote | string | no | Quote character in case of CSV, options: single quote ('), double quote ("), none, or custom; default: none |
| nullIdentifier | string | no | In case of CSV, when column is empty, the filled specified content is empty by default |
| selectedColumnName | string | Required in case of CSV and parquet | In case of CSV and parquet, the selected column name, the column name parameters separated by comma |
| selectedColumnType | string | Required in case of parquet | In case of parquet, the selected column type, the column type parameters separated by comma |
Response
- Response headers
No additional headers are required beyond the standard response headers.
- Response parameters
| Parameter name | Types | Can it be empty | Description |
|---|---|---|---|
| logShipperID | string | no | Logshipper ID |
Error code
Apart from standard error codes, the following codes may be returned:
| Error code | Error message | Description | HTTP status code |
|---|---|---|---|
| LogStoreNotFound | LogStore [logStoreName] not exists | Logstore not exist | 404 |
Note: [logStoreName] in error message may be replaced with a specific name.
Example
- Request example
Http
1POST /v1/logshipper 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 "project":"default",
7 "logStoreName":"logstore1",
8 "logShipperName":"shipper1",
9 "startTime":"2021-01-12T01:01:00Z",
10 "destType":"BOS",
11 "destConfig":{
12 "BOSPath":"users-Bucket1/",
13 "partitionFormatTS":"%Y/%m/%d/%H/%M/",
14 "partitionFormatLogStream":true,
15 "maxObjectSize":50,
16 "compressType":"snappy",
17 "deliverInterval":30,
18 "storageFormat":"json"
19 }
20}
- Response example
Http
1HTTP/1.1 201
2Content-Type: application/json; charset=utf-8
3{
4 "logShipperID":"123123-xxxxxxx"
5}
