文档

0046-00000003

更新时间:

问题描述

修改实时日志自定义字段请求中字段列表为空。

问题原因

您发起了PutUserDefinedLogFieldsConfig该配置实时日志自定义字段,但是请求中字段列表为空。

问题示例

以下请求使用PutUserDefinedLogFieldsConfig接口修改Bucket实时日志自定义字段,服务端返回该错误。

PUT /?userDefinedLogFieldsConfig HTTP/1.1
Date: GMT Date
Content-Length:ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue

<?xml version="1.0" encoding="UTF-8"?>
<UserDefinedLogFieldsConfiguration>
	<HeaderSet>
	</HeaderSet>
         <ParamSet>
         </ParamSet>
</UserDefinedLogFieldsConfiguration>

上述请求中HeaderSet和ParamSet都为空,导致接口报错。

解决方案

确保请求中HeaderSet和ParamSet不能同时为空:

PUT /?userDefinedLogFieldsConfig HTTP/1.1
Date: GMT Date
Content-Length:ContentLength
Content-Type: application/xml
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue

<?xml version="1.0" encoding="UTF-8"?>
<UserDefinedLogFieldsConfiguration>
	<HeaderSet>
		<header>header3</header>
	</HeaderSet>
</UserDefinedLogFieldsConfiguration>

相关文档

请参见PutUserDefinedLogFieldsConfig