Modifies the log field configuration of a protected object.
Operation description
Before you invoke this operation, make sure you have completed the following steps:
Invoke the DescribeDefenseResourceNames operation to obtain the names of created protected objects.
Invoke the DescribeResourceLogStatus operation to query the enabling status of logs for the protected object. If logging is not enabled, invoke the ModifyResourceLogStatus operation to enable logging (Status=true). After completing the preceding steps, invoke this operation to modify the log field configuration of the protected object.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-waf:ModifyResourceLogFieldConfig |
update |
*All Resource
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the WAF instance. Note
You can call DescribeInstance to query the ID of the current WAF instance. |
waf_v3prepaid_public_cn-uax****3k0e |
| FieldList |
string |
Yes |
The list of log fields to deliver. Specify the fields in the "a,b,c,..." format. Note
|
account,acl_action,acl_rule_id,acl_rule_type,acl_test,antiscan_action,antiscan_rule_id,antiscan_rule_type,antiscan_test,body_bytes_sent,bypass_matched_ids |
| ExtendConfig |
string |
No |
The log delivery extension configuration. The value is a string converted from a JSON object constructed with a series of parameters. Note
For more information, see the Log delivery extension configuration parameter description. |
{\"request_header\":\"Ali-Cdn-Real-Ip\"} |
| DeliveryType |
string |
Yes |
The log delivery type. Valid values:
|
sls |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
| RegionId |
string |
No |
The region where the WAF instance resides. Valid values:
|
cn-hangzhou |
| Resource |
string |
Yes |
The protected object to modify. |
cwaf-***-waf |
| LogDeliveryStrategy |
string |
No |
The log delivery strategy. Multiple strategies are supported. The value is a string converted from a JSON array constructed with a series of parameters. Note
For more information, see the Log delivery strategy parameter description. |
[{\"logType\":\"blockLog\",\"rate\":100},{\"logType\":\"normalRequestLog\",\"rate\":100},{\"logType\":\"checkLog\",\"rate\":100}] |
Log delivery strategy (LogDeliveryStrategy) parameter description.
Parameter description
| Name | Type | Required | Example | Description |
| logType | String | Yes | blockLog | The log type. Valid values: - blockLog: block log. - normalRequestLog: normal request log. - checkLog: detection log. |
| rate | Integer | Yes | 90 | The log sampling ratio. Valid values: 1 to 100. |
Log delivery extension configuration (ExtendConfig) parameter description.
Parameter description
| Name | Type | Required | Example | Description |
| request_header | String | Yes | blockLog | The request headers for log delivery. A maximum of five request headers are supported. Specify the headers in the "a,b,c,..." format. Important If the log fields to deliver include request_header, this configuration is required. Otherwise, the default configurations of all fields fail to be modified. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
D7861F61-5B61-46CE-A47C-6B**** |
Examples
Success response
JSON format
{
"RequestId": "D7861F61-5B61-46CE-A47C-6B****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.