本文介绍OSS日志字段详情。

OSS日志类型

日志类型 说明
访问明细日志 记录相关OSS Bucket的所有访问日志及批量删除日志时具体的删除信息,实时采集,同时也包含计量日志。
说明 当您调用DeleteObjects接口时,访问日志中会有一条请求记录。
计量日志 记录特定OSS Bucket每小时累计的计量数据。延迟时间为几小时,用于辅助分析,默认免费开通。
时序监控数据 记录10秒粒度的请求、延迟、流量等指标及5分钟粒度的请求、流量等指标。默认免费开通。

访问明细日志

字段 说明
time OSS收到请求的时间,例如27/Feb/2018:13:58:45。

如果需要时间戳,可以使用__time__字段。

access_id 请求者的AccessKey ID。
owner_id OSS Bucket拥有者的阿里云账号ID。
user_agent HTTP的User-Agent头,例如curl/7.15.5。
logging_flag 是否开启定期导出日志到OSS Bucket的功能。其中,true表示开启。
bucket OSS Bucket名称。
content_length_in 请求头中Content-Length的值,单位:字节。
content_length_out 响应头中Content-Length的值,单位:字节。
object 请求的OSS Object,格式为URL编码。

查询时可以使用select url_decode(object)解码。

object_size OSS Object的大小,单位:字节。
operation 访问类型。更多信息,请参见附录:访问类型
bucket_location OSS Bucket所在的数据中心,一般格式为oss-<region ID>
request_uri HTTP请求的URI,包括query-string,格式为URL编码。

查询时可以使用select url_decode(request_uri)解码。

error_code OSS返回的错误码。更多信息,请参见错误响应
request_length HTTP请求的大小,包括header,单位:字节。
client_ip 发起请求的IP地址,即客户端IP地址、其网络防火墙或Proxy IP地址。
response_body_length HTTP响应中的Body大小,不包括header。
http_method HTTP请求方法。
referer 请求的HTTP Referer。
requester_id 请求者的ID,如果是匿名访问,则显示为短划线(-)。
request_id 请求ID。
response_time HTTP响应时间,单位:毫秒。
server_cost_time OSS服务器处理本次请求所花的时间,单位:毫秒。
http_type HTTP请求类型,包括HTTP和HTTPS。
sign_type 签名类型。
  • NotSign:未签名。
  • NormalSign:一般方式签名。
  • UriSign:通过URL签名。
  • AdminSign:管理员账号。
http_status HTTP请求返回的状态。
sync_request 同步请求类型 。
  • 短划线(-):一般请求。
  • cdn:CDN回源。
  • sync-public:跨区域复制。
  • lifecycle:设置生命周期规则。
bucket_storage_type OSS Object存储类型。
  • standard:标准存储类型。
  • archive:归档存储类型。
  • IA:低频访问存储类型。
host 请求访问域名,例如:bucket123.oss-cn-beijing.aliyuncs.com。
vpc_addr OSS所在VPC的Havip地址。

该地址为整数类型(例如343819108),您可以使用int_to_ip(cast(vpc_addr as bigint)),将其转换为IP地址形式。

vpc_id OSS所在VPC的ID。
delta_data_size OSS Object大小的变化量,如果没有变化则为0;如果不是上传请求,则为短划线(-) 。
acc_access_region 如果是传输加速请求,该字段为请求接入点所在地域名,否则为短划线(-)。
restore_priority 解冻优先级。
extend_information 扩展字段,默认为短划线(-)。

如果是通过RAM角色发起的请求,则日志会记录相关的RAM角色信息,拼接规则为requesterParentId,roleName,roleSessionName,roleOwnerId,以半角逗号(,)分隔,可能会继续拼接新字段。

user_defined_log_fields 扩展字段,默认为短划线(-)。

如果您为该Bucket配置了自定义header和param,则日志会记录与配置中相匹配的header和param的信息,为一个JSON字段进行base64编码后的值。

计量日志

字段 说明
owner_id OSS Bucket拥有者的阿里云账号ID。
bucket OSS Bucket名称。
cdn_in CDN流入量,单位:字节。
cdn_out CDN流出量,单位:字节。
metering_datasize 非标准存储的计量数据大小。
get_request GET请求次数。
intranet_in 内网流入量,单位:字节。
intranet_out 内网流出量,单位:字节。
network_in 外网流入量,单位:字节。
network_out 外网流出量,单位:字节。
put_request PUT请求次数。
storage OSS Bucket存储量,单位:字节。
storage_type OSS Bucket存储类型 。
  • standard:标准存储类型。
  • archive:归档存储类型。
  • IA:低频访问存储类型。
process_img_size 处理的图像大小,单位:字节。
sync_in 同步流入量,单位:字节。
sync_out 同步流出量,单位:字节。
start_time 计量开始时间戳,单位:秒。
end_time 计量截止时间戳,单位:秒。
region OSS Bucket所在地域。
process_img 处理图像。
bucket_location OSS Bucket所在的数据中心,一般格式为oss-<region ID>。

时序监控指标

本文涉及的指标遵循时序数据格式,支持使用PromQL或SQL进行查询分析。更多信息,请参见时序数据查询与分析简介

指标 单位 说明 标签
private_net_in_traffic_10s byte 每10秒内的内网流入流量。 owner_id、region、bucket、storage_type、operation、sync_type
private_net_out_traffic_10s byte 每10秒内的内网流出流量。 owner_id、region、bucket、storage_type、operation、sync_type
public_net_in_traffic_10s byte 每10秒内的公网流入流量。 owner_id、region、bucket、storage_type、operation、sync_type
public_net_out_traffic_10s byte 每10秒内的公网流出流量。 owner_id、region、bucket、storage_type、operation、sync_type
cdn_in_10s byte 每10秒内的CDN流入流量。 owner_id、region、bucket、storage_type、operation、sync_type
cdn_out_10s byte 每10秒内的CDN流出流量。 owner_id、region、bucket、storage_type、operation、sync_type
sync_in_10s byte 每10秒内的同步请求流入流量。 owner_id、region、bucket、storage_type、operation、sync_type
sync_out_10s byte 每10秒内的同步请求流出流量。 owner_id、region、bucket、storage_type、operation、sync_type
request_cnt_total_10s Count 每10秒内的请求总数。 owner_id、region、bucket、storage_type、operation、sync_type
write_qps_10s Count 每10s内的计费PUT、POST、HEAD请求次数。 owner_id、region、bucket、storage_type、operation、sync_type
read_qps_10s Count 每10秒内的计费GET请求次数。 owner_id、region、bucket、storage_type、operation、sync_type
error_4xx_10s Count 每10秒内的4xx请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
error_403_10s Count 每10秒内的403请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
error_404_10s Count 每10秒内的404请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
error_408_10s Count 每10秒内的408请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
error_499_10s Count 每10秒内的499请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
error_5xx_10s Count 每10秒内的5xx请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
error_503_10s Count 每10秒内的503请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
success_2xx_10s Count 每10秒内的2xx请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
success_203_10s Count 每10秒内203请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
success_3xx_10s Count 每10秒内的3xx请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
client_latency_10s millsecond 每10秒内的客户端延迟。 owner_id、region、bucket、storage_type、operation、sync_type
server_latency_10s millsecond 每10秒内的服务端延迟。 owner_id、region、bucket、storage_type、operation、sync_type
request_cnt_level4_10s Count 每10秒内的请求个数,对应的请求文件大于1 MB。 owner_id、region、bucket、storage_type、operation、sync_type
client_latency_level4_10s millsecond 每10秒内的客户端延迟,对应的请求文件大于1 MB。 owner_id、region、bucket、storage_type、operation、sync_type
server_latency_level4_10s millsecond 每10秒内的服务端延迟,对应的请求文件大于1 MB。 owner_id、region、bucket、storage_type、operation、sync_type
request_cnt_level2_10s Count 每10秒内的请求个数,对应的请求文件在100 KB~200 KB之间。 owner_id、region、bucket、storage_type、operation、sync_type
client_latency_level2_10s millsecond 每10秒内的客户端延迟,对应的请求文件在100 KB~200 KB之间。 owner_id、region、bucket、storage_type、operation、sync_type
server_latency_level2_10s millsecond 每10秒内的服务端延迟,对应的请求文件在100 KB~200 KB之间。 owner_id、region、bucket、storage_type、operation、sync_type
request_cnt_level1_10s Count 每10秒内的请求个数,对应的请求文件小于100 KB。 owner_id、region、bucket、storage_type、operation、sync_type
client_latency_level1_10s millsecond 每10秒内的客户端延迟,对应的请求文件小于100 KB。 owner_id、region、bucket、storage_type、operation、sync_type
server_latency_level1_10s millsecond 每10秒内的服务端的延迟,对应的请求文件小于100 KB。 owner_id、region、bucket、storage_type、operation、sync_type
request_cnt_level3_10s Count 每10秒内的请求个数,对应的请求文件在200 KB~1 MB之间。 owner_id、region、bucket、storage_type、operation、sync_type
client_latency_level3_10s millsecond 每10秒内的客户端延迟,对应的请求文件在200 KB~1 MB。 owner_id、region、bucket、storage_type、operation、sync_type
server_latency_level3_10s millsecond 每10秒内的服务端延迟,对应的请求文件在200 KB~1 MB。 owner_id、region、bucket、storage_type、operation、sync_type
error_timeout_10s Count 每10秒内超时的请求个数。 owner_id、region、bucket、storage_type、operation、sync_type
delta_add_10s byte 每10秒内的存储增量。 owner_id、region、bucket、storage_type、operation、sync_type
delta_del_10s byte 每10秒内的存储减量。 owner_id、region、bucket、storage_type、operation、sync_type
top_object_pv_5m Count 每5分钟内Top文件访问次数。 owner_id、region、bucket、storage_type、object
top_object_bandwidth_out_5m byte 每5分钟内Top文件流出流量。 owner_id、region、bucket、storage_type、object
top_object_bandwidth_in_5m byte 每5分钟内Top文件流入流量。 owner_id、region、bucket、storage_type、object
top_ip_method_pv_5m Count 每5分钟内Top IP地址访问次数。 owner_id、region、bucket、storage_type、operation、client_ip
top_ip_method_bandwidth_out_5m byte 每5分钟内Top IP地址流出流量。 owner_id、region、bucket、storage_type、operation、client_ip
top_ip_method_bandwidth_in_5m byte 每5分钟内Top IP地址流入流量。 owner_id、region、bucket、storage_type、operation、client_ip
top_ip_storage_pv_5m Count 每5分钟内Top IP地址访问次数。 owner_id、region、bucket、storage_type、client_ip
top_ip_storage_bandwidth_out_5m byte 每5分钟内Top IP地址流出流量。 owner_id、region、bucket、storage_type、client_ip
top_ip_storage_bandwidth_in_5m byte 每5分钟内Top IP地址流入流量。 owner_id、region、bucket、storage_type、client_ip
top_refer_pv_5m Count 每5分钟内Top Refer访问次数。 owner_id、region、bucket、storage_type、refer

其中,标签字段说明如下表所示。

标签字段 说明
owner_id OSS Bucket拥有者的阿里云账号ID。
region OSS Bucket所在地域。
bucket OSS Bucket名称。
object OSS对象名称。
storage_type OSS Bucket存储类型。
operation 访问类型。更多信息,请参见附录:访问类型
sync_type 同步类型。
client_ip 访问来源IP地址。
refer 请求的HTTP Refer。

附录:访问类型

访问类型如下表所示。更多信息,请参见API概览

操作 说明
AbortMultiPartUpload 断点上传-中止。
AppendObject 追加上传文件。
CompleteUploadPart 完成断点上传。
CopyObject 复制文件。
DeleteBucket 删除Bucket。
DeleteLiveChannel 删除LiveChannel。
DeleteObject 删除文件。
DeleteObjects 删除多个文件。
GetBucket 列举文件。
GetBucketAcl 获取Bucket权限。
GetBucketCors 查看Bucket的CORS规则。
GetBucketEventNotification 获取Bucket通知配置。
GetBucketInfo 查看Bucket信息。
GetBucketLifecycle 查看Bucket的Lifecycle配置。
GetBucketLocation 查看Bucket地域。
GetBucketLog 查看Bucket访问日志配置。
GetBucketReferer 查看Bucket防盗链设置。
GetBucketReplication 查看跨地域复制。
GetBucketReplicationProgress 查看跨地域复制进度。
GetBucketStat 获取bucket的相关信息。
GetBucketWebSite 查看Bucket的静态网站托管状态。
GetLiveChannelStat 获取LiveChannel状态信息。
GetObject 读取文件。
GetObjectAcl 获取文件访问权限。
GetObjectInfo 获取文件信息。
GetObjectMeta 查看文件信息。
GetObjectSymlink 获取symlink文件的详细信息。
GetPartData 获取断点文件块数据。
GetPartInfo 获取断点文件块信息。
GetProcessConfiguration 获取Bucket图片处理配置。
GetService 列举Bucket。
HeadBucket 查看Bucket信息。
HeadObject 查看文件信息。
InitiateMultipartUpload 初始化断点上传文件。
ListMultiPartUploads 列举断点事件。
ListParts 列举断点块状态。
PostObject 表单上传文件。
PostProcessTask 提交相关的数据处理,例如截图等。
PostVodPlaylist 创建LiveChannel点播列表。
ProcessImage 图片处理。
PutBucket 创建Bucket。
PutBucketCors 设置Bucket的CORS规则。
PutBucketLifecycle 设置Bucket的Lifecycle配置。
PutBucketLog 设置Bucket访问日志。
PutBucketWebSite 设置Bucket静态网站托管模式。
PutLiveChannel 创建LiveChannel。
PutLiveChannelStatus 设置LiveChannel状态。
PutObject 上传文件。
PutObjectAcl 修改文件访问权限。
PutObjectSymlink 创建symlink文件。
RedirectBucket bucket endpoint重定向。
RestoreObject 解冻文件。
UploadPart 断点上传文件。
UploadPartCopy 复制文件块。
get_image_exif 获取图片的exif信息。
get_image_info 获取图片的长宽等信息。
get_image_infoexif 获取图片的长宽以及exif信息。
get_style 获取Bucket样式。
list_style 列举Bucket的样式。
put_style 创建Bucket样式。