Creates a custom log delivery task to deliver logs to destinations such as SLS, HTTP, OSS, S3, or Kafka.
Operation description
This operation allows you to create a delivery node for specific log data. Multiple delivery destinations and detailed configuration options are supported, including but not limited to Simple Log Service (SLS), HTTP services, Alibaba Cloud Object Storage Service (OSS), S3-compatible storage, and Kafka MSMQ. You can customize the node name, select log fields, specify a data center, set the discard rate, select a delivery type, and configure the corresponding delivery details based on the selected type.
Field selection: Use
FieldNameto specify the log fields to deliver.Filter rules: Use
FilterRulesto implement pre-processing and filtering of log data.Diverse delivery: Supports SLS, HTTP(S), Alibaba Cloud OSS, S3-compatible storage, and Kafka delivery methods, each with its own specific configuration parameters.
Before you begin
Ensure that the provided credentials (such as AccessKey and SecretKey) have sufficient permissions to perform the delivery operation.
When you select a delivery method that requires encryption or authentication, correctly configure the related security parameters.
Verify the syntax of
FilterRulesto ensure that the filtering logic meets your expectations.Adjust advanced parameters such as the maximum number of retries and timeout period as needed to optimize delivery efficiency and stability.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| BusinessType |
string |
Yes |
The real-time log type. Valid values:
|
dcdn_log_er_pod |
| DataCenter |
string |
No |
The data center. Valid values:
|
cn |
| TaskName |
string |
Yes |
The task name. |
test_project |
| FieldName |
string |
Yes |
The fields to deliver, separated by commas (,). |
ClientIP,ClientRequestURI,EdgeResponseStatusCode |
| DeliveryType |
string |
Yes |
The delivery type. Valid values:
|
sls |
| DiscardRate |
number |
No |
The discard rate. Default value: 0. |
0 |
| S3Delivery |
object |
No |
The S3 or S3-compatible delivery configuration parameters. |
|
| Region |
string |
No |
The region where the service resides. |
cn-shanghai |
| BucketPath |
string |
No |
The bucket storage path. |
logriver-test/log |
| AccessKey |
string |
No |
The AccessKey ID of the S3 account. |
g0f46623ll0g0 |
| SecretKey |
string |
No |
The SecretKey of the S3 account. |
*** |
| Endpoint |
string |
No |
The S3 endpoint address. |
https://s3.oss-cn-hangzhou.aliyuncs.com |
| PrefixPath |
string |
No |
The storage path prefix. |
logriver-test/log |
| S3Cmpt |
boolean |
No |
Specifies whether the storage is S3-compatible. |
true |
| ServerSideEncryption |
boolean |
No |
Specifies whether to enable S3 server-side encryption. To configure server-side encryption for the S3 bucket, refer to OSS Server-side encryption. |
false |
| VertifyType |
string |
No |
The key verification method for S3 delivery. Note
The key configuration comes from the console or SDK. Keys from the console are encrypted during transmission. Keys from the SDK do not require encryption. |
console |
| OssDelivery |
object |
No |
The OSS delivery configuration parameters. |
|
| Region |
string |
No |
The OSS region. |
cn-hangzhou |
| Aliuid |
string |
No |
The Alibaba Cloud account ID. |
1234*** |
| BucketName |
string |
No |
The bucket name. |
test_rlog |
| PrefixPath |
string |
No |
The OSS storage path prefix. |
test/ |
| HttpDelivery |
object |
No |
The HTTP delivery configuration parameters. |
|
| DestUrl |
string |
No |
The HTTP server delivery address. |
http://xxx.aliyun.com/v1/log/upload |
| StandardAuthOn |
boolean |
No |
Specifies whether to use standard authentication. |
true |
| StandardAuthParam |
object |
No |
The standard authentication parameters. |
|
| PrivateKey |
string |
No |
The private key. |
xxxx |
| ExpiredTime |
integer |
No |
The encryption timeout period. Note
The value must be greater than 0. A value of 300 or greater is recommended. Unit: seconds. |
300 |
| UrlPath |
string |
No |
The URL path. |
v1/log/upload |
| MaxBatchSize |
integer |
No |
The maximum number of log entries per delivery batch. |
1000 |
| MaxBatchMB |
integer |
No |
The maximum size of a single delivery batch. Unit: MB. |
5 |
| MaxRetry |
integer |
No |
The maximum number of retries. |
3 |
| TransformTimeout |
integer |
No |
The timeout period. Unit: seconds. |
10 |
| LogBodyPrefix |
string |
No |
The prefix of the log delivery package. |
cdnVersion:1.0 |
| LogBodySuffix |
string |
No |
The suffix of the log delivery package. |
cdnVersion:1.0 |
| Compress |
string |
No |
The compression method. |
gzip |
| LogSplitWords |
string |
No |
The log separator. |
\n |
| HeaderParam |
object |
No |
The Custom Header. |
|
|
object |
No |
The Custom Header. |
||
| StaticValue |
string |
No |
The HTTP delivery request header configuration. Note
Key-map. The value can be a static value, a dynamic function, or a dynamic value. |
x-auth: sk-*** |
| QueryParam |
object |
No |
The custom request parameters. |
|
|
object |
No |
The custom request parameters. |
||
| StaticValue |
string |
No |
The HTTP delivery QueryString parameter configuration. Note
Key-map. The value can be a static value, a dynamic function, or a dynamic value. |
auth_token: sk-*** |
| LogSplit |
boolean |
No |
Specifies whether to enable log segmentation. Default value: true. |
true |
| LastLogSplit |
boolean |
No |
The trailing separator. |
\n |
| KafkaDelivery |
object |
No |
The Kafka delivery configuration parameters. |
|
| Topic |
string |
No |
The Kafka message topic. |
dqc_test2 |
| UserAuth |
boolean |
No |
Specifies whether to enable user authentication. |
true |
| UseTLS |
boolean |
No |
Specifies whether to enable SASL-encrypted transmission for Kafka delivery. Note
The delivery address must be configured with a public certificate. Verification with a self-signed certificate will fail. |
false |
| MachanismType |
string |
No |
The encryption method. |
plain |
| UserName |
string |
No |
The encryption username. |
xxx |
| Password |
string |
No |
The encryption password. |
xxx |
| Brokers |
array |
No |
The server array. |
|
|
string |
No |
The list of Kafka broker servers. |
192.168.0.1:9902 |
|
| Compress |
string |
No |
The compression method. By default, no compression is applied. |
lz4 |
| Balancer |
string |
No |
The load balancing method. |
kafka.LeastBytes |
| SlsDelivery |
object |
No |
The SLS delivery configuration. |
|
| SLSRegion |
string |
No |
The region where Simple Log Service (SLS) resides. |
cn-hangzhou |
| SLSProject |
string |
No |
The Simple Log Service (SLS) project name. |
dcdn-test20240417 |
| SLSLogStore |
string |
No |
The Simple Log Service (SLS) Logstore name. |
accesslog-test |
| Details |
string |
No |
The list of Edge Routine (ER) pods to configure. |
xxx,xxx |
| FilterVer |
string |
No |
The version of the filter rule. Note
This parameter is used for backward compatibility with legacy filter rules. The default value is v1. New tasks use v2. |
v2 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
2CCD40B1-3F20-5FF0-8A67-E3F34B87744F |
| TaskName |
string |
The task name. |
er-http |
| DataCenter |
string |
The data center. Valid values:
|
cn |
| Status |
string |
The task status. |
online |
Examples
Success response
JSON format
{
"RequestId": "2CCD40B1-3F20-5FF0-8A67-E3F34B87744F",
"TaskName": "er-http",
"DataCenter": "cn",
"Status": "online"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InternalError | An internal exception occurred, please try again later. | An inner exception was triggered. Please try again later. |
| 400 | InvalidParameter | Invalid parameter. Check the parameter configuration. | Invalid parameter. Check the parameter configuration. |
| 403 | ErService.NotOpen | Er service has not opend. | Er service has not opend. |
| 403 | RealTimeLog.S3EndpointInvalidError | Invalid S3 information for the delivery task. Check your configurations and try again. | Invalid S3 information for the delivery task. Check your configurations and try again. |
| 403 | RealTimeLog.KafkaBrokersExceedError | The number of Kafka Broker addresses for real-time log delivery has reached the upper limit (50). | The number of Kafka Broker addresses for real-time log delivery has reached the upper limit (50). |
| 403 | RealTimeLog.StatusQuotaError | The maximum number of real-time log delivery tasks has been reached. Check your plan quota and upgrade the plan to request a quota increase. | The maximum number of real-time log delivery tasks has been reached. Check your plan quota and upgrade the plan to request a quota increase. |
| 403 | EsaService.NotOpen | ESA service has not opend. | Edge Security Accelerator (ESA) is not turned on |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.