This topic describes different types of Object Storage Service (OSS) logs and the fields in each type of log.

OSS log types

Log type Description
Access logs This type of log records access to OSS buckets. Access logs are collected in real time.
Batch deletion logs This type of log records information about deleted objects. Batch deletion logs are collected in real time.
Note When you call the DeleteObjects operation, an access log is generated to record the request.
Hourly metering logs This type of log records hourly metering statistics for an OSS bucket, which helps you analyze data. Hourly metering logs are collected several hours after they are generated.

OSS built-in logging and Log Service-powered OSS logging

OSS provides the real-time log query feature, which is powered by Log Service. If you enable the feature, Log Service collects and stores OSS access logs, batch deletion logs, and hourly metering logs of OSS. You can perform various operations on the logs. For example, you can query and analyze the logs. OSS built-in logging is a built-in feature of OSS. This feature records and stores the access logs of OSS.

Log Service records the same access logs as OSS, but the log fields are different. For more information, see Access logs.
Field of OSS access logs recorded in OSS Field of OSS access logs recorded in Log Service
Remote IP client_ip
Time time
Request-URI request-uri
HTTP Status http_status
SentBytes response_body_length
RequestTime (ms) response_time
Referer referer
User-Agent user-agent
HostName host
Request ID request_id
LoggingFlag logging_flag
Requester Aliyun ID requester_id
Operation operation
Bucket bucket
Key object
ObjectSize object_size
Server Cost Time (ms) server_cost_time
Error Code error_code
Request Length request_length
UserID owner_id
Delta DataSize delta_data_size
Sync Request sync_request

Access logs

Field Description
__topic__ The topic of the log. The value is fixed as oss_access_log.
acc_access_region The region of the OSS endpoint that is specified in the request. If the request is sent when the transfer acceleration feature is enabled, the value of this field is the name of the region. If the request is sent when the transfer acceleration feature is disabled, the value of this field is a hyphen (-).
access_id The AccessKey ID of the requester.
bucket The name of the OSS bucket.
bucket_location The data center where the OSS bucket resides. The value is in the oss-<Region ID> format.
bucket_storage_type The storage class of the OSS object. Valid values:
  • standard: the Standard storage class
  • archive: the Archive storage class
  • infrequent_access: the Infrequent Access storage class
client_ip The IP address from which the request is sent. The IP address can be the IP address of a client, firewall, or proxy.
content_length_in The value of the Content-Length header in the request. Unit: bytes.
content_length_out The value of the Content-Length header in the response. Unit: bytes.
delta_data_size The change to the size of an OSS object. If the object size does not change, the value of this field is 0. If the request is not an upload request, the value of this field is a hyphen (-).
error_code The error code that is returned by OSS. For more information, see Error responses.
host The endpoint of the OSS bucket. Example: bucket123.oss-cn-beijing.aliyuncs.com.
http_method The HTTP request method.
http_status The HTTP status code.
http_type The protocol over which the request is sent. Valid values: HTTP and HTTPS.
logging_flag Indicates whether logging is enabled to export logs to an OSS bucket at regular intervals. A value of true indicates that the feature is enabled.
object The URL-encoded object that is requested. You can include select url_decode(object) in your query statement to decode the object.
object_size The size of the object. Unit: bytes.
operation The API operation. For more information, see API operations.
owner_id The ID of the Alibaba Cloud account to which the OSS bucket belongs.
referer The Referer header of the HTTP request.
request_id The ID of the request.
request_length The size of the HTTP request. The headers of the request are counted. Unit: bytes.
request_uri The URL-encoded URI of the HTTP request. The query string is included. You can include select url_decode(request_uri) in your query statement to decode the URI.
requester_id The ID of the requester. If the request is sent by an anonymous user, the value of this field is a hyphen (-).
response_body_length The size of the HTTP response body.
response_time The HTTP response time. Unit: milliseconds.
server_cost_time The time that is consumed by the OSS server to process the request. Unit: milliseconds.
sign_type The type of the signature. Valid values:
  • NotSign: The request is not signed.
  • NormalSign: The request is signed by using a regular signature.
  • UriSign: The request is signed by using a URL signature.
  • AdminSign: The request is signed by using an administrator account.
sync_request The type of the synchronization request. Valid values:
  • hyphen (-): general request
  • cdn: CDN back-to-origin request
  • sync-public: cross-region replication request
  • lifecycle: lifecycle rule configuration request
time The time at which OSS receives the request. Example: 27/Feb/2018:13:58:45. If you need a timestamp, you can use the __time__ field.
user-agent The User-Agent header of the HTTP request. Example: curl/7.15.5.
vpc_addr The virtual IP address (VIP) of the server that resides in a Virtual Private Cloud (VPC) and hosts the OSS bucket.

Data type: integer. Example: 343819108. You can convert the VIP to an IP address by using the int_to_ip(cast(vpc_addr as bigint)) function.

vpc_id The ID of the VPC.
restore_priority The priority of the log in the event of log data restoration.
extend_information The extended fields. Default value: hyphen (-).

If the request is initiated by using a RAM role, the log records the information about the RAM role. The information is in the requesterParentId,roleName,roleSessionName,roleOwnerId format. The fields in the information are separated with commas (,). New fields can be added to the information.

Batch deletion logs

When you call the DeleteObjects operation, an access log is generated to record the request. The information about the objects that you specify in the DeleteObjects operation is carried in the body of the request. Therefore, the value of the object field in the generated access log is a hyphen (-). If you want to view the information about deleted objects, you must obtain batch deletion logs. You can use the request_id field in a batch deletion log to find the request that is used to delete objects. The following table describes the fields in a batch deletion log.

Field Description
__topic__ The topic of the log. The value is fixed as oss_batch_delete_log.
client_ip The IP address from which the request is sent. The IP address can be the IP address of a client, firewall, or proxy.
user_agent The User-Agent header of the HTTP request. Example: curl/7.15.5.
bucket The name of the OSS bucket.
error_code The error code that is returned by OSS. For more information, see Error responses.
request_length The size of the HTTP request. The headers of the request are counted. Unit: bytes.
response_body_length The size of the HTTP response body. The headers of the response are not counted.
object The URL-encoded object that is requested. You can include select url_decode(object) in your query statement to decode the object.
object_size The size of the object. Unit: bytes.
operation The API operation. For more information, see API operations.
bucket_location The data center where the OSS bucket resides. The value is in the oss-<Region ID> format.
http_method The HTTP request method. Example: POST.
referer The Referer header of the HTTP request.
request_id The ID of the request.
http_status The HTTP status code.
sync_request The type of the synchronization request. Valid values:
  • hyphen (-): general request
  • cdn: CDN back-to-origin request
  • sync-public: cross-region replication request
request_uri The URL-encoded URI of the request. The query string is included. You can include select url_decode(request_uri) in your query statement to decode the URI.
host The endpoint of the OSS bucket. Example: bucket123.oss-cn-beijing.aliyuncs.com.
logging_flag Indicates whether logging is enabled to export logs to an OSS bucket at regular intervals. A value of true indicates that the feature is enabled.
server_cost_time The time that is consumed by the OSS server to process the request. Unit: milliseconds.
owner_id The ID of the Alibaba Cloud account to which the OSS bucket belongs.
requester_id The ID of the requester. If the request is sent by an anonymous user, the value of this field is a hyphen (-).
delta_data_size The change to the size of an OSS object. If the object size does not change, the value of this field is 0. If the request is not an upload request, the value of this field is a hyphen (-).

Hourly metering logs

Hourly metering logs record hourly metering statistics for an OSS bucket, which helps you analyze data.

Field Description
__topic__ The topic of the log. The value is fixed as oss_metering_log.
owner_id The ID of the Alibaba Cloud account to which the OSS bucket belongs.
bucket The name of the OSS bucket.
cdn_in The inbound traffic from CDN to the OSS bucket. Unit: bytes.
cdn_out The outbound traffic from the OSS bucket to CDN. Unit: bytes.
get_request The number of GET requests.
intranet_in The inbound traffic over an internal network. Unit: bytes.
intranet_out The outbound traffic over an internal network. Unit: bytes.
network_in The inbound traffic over the Internet. Unit: bytes.
network_out The outbound traffic over the Internet. Unit: bytes.
put_request The number of PUT requests.
storage_type The storage class of the OSS bucket. Valid values:
  • standard: the Standard storage class
  • archive: the Archive storage class
  • infrequent_access: the Infrequent Access storage class
storage The amount of data in the OSS bucket. Unit: bytes.
metering_datasize The amount of data whose storage class is not Standard in the OSS bucket.
process_img_size The size of the image that is processed. Unit: bytes.
process_img The information about the image that is processed.
sync_in The inbound traffic that is generated by the synchronization operation. Unit: bytes.
sync_out The outbound traffic that is generated by the synchronization operation. Unit: bytes.
start_time The start timestamp of a metering operation.
end_time The end timestamp of a metering operation.
region The region where the OSS bucket resides.
bucket_location The data center where the OSS bucket resides. The value is in the oss-<Region ID> format.

API operations

The following table describes the supported API operations. For more information, see List of operations by function.

Operation Description
AbortMultiPartUpload Cancels a multipart upload task.
AppendObject Appends an object to an existing object.
CompleteUploadPart Completes the multipart upload tasks of an object.
CopyObject Copies an object.
DeleteBucket Deletes a bucket.
DeleteLiveChannel Deletes a LiveChannel.
DeleteObject Deletes an object.
DeleteObjects Deletes multiple objects.
GetBucket Queries the information about all objects in a bucket.
GetBucketAcl Queries the access control list (ACL) of a bucket.
GetBucketCors Queries the cross-origin resource sharing (CORS) rules of a bucket.
GetBucketEventNotification Queries the notification configurations of a bucket.
GetBucketInfo Queries the information about a bucket.
GetBucketLifecycle Queries the lifecycle rules that are configured for the objects in a bucket.
GetBucketLocation Queries the region where a bucket resides.
GetBucketLog Queries the access logging configurations of a bucket.
GetBucketReferer Queries the hotlink protection rules that are configured for a bucket.
GetBucketReplication Queries the cross-region replication (CRR) rules that are configured for a bucket.
GetBucketReplicationProgress Queries the progress of a CRR task that is performed on a bucket.
GetBucketStat Queries the information about a bucket.
GetBucketWebSite Queries the status of static website hosting for a bucket.
GetLiveChannelStat Queries the status of a LiveChannel.
GetObject Queries an object.
GetObjectAcl Queries the ACL of an object.
GetObjectInfo Queries the information about an object.
GetObjectMeta Queries the metadata of an object.
GetObjectSymlink Queries the symbolic link of an object.
GetPartData Queries the data in all parts of an object.
GetPartInfo Queries the information about all parts of an object.
GetProcessConfiguration Queries the image processing configurations of a bucket.
GetService Queries all buckets.
HeadBucket Queries the information about a bucket.
HeadObject Queries the metadata of an object.
InitiateMultipartUpload Initializes a multipart upload task.
ListMultiPartUploads Queries all multipart upload tasks in progress.
ListParts Queries all the parts that are uploaded in a specified multipart upload task.
PostObject Uploads an object by using an HTML form.
PostProcessTask Commits data processing operations, such as screenshot.
PostVodPlaylist Creates a playlist for a LiveChannel.
ProcessImage Processes an image.
PutBucket Creates a bucket.
PutBucketCors Configures CORS rule for a bucket.
PutBucketLifecycle Configures lifecycle rules for a bucket.
PutBucketLog Configures access logging for a bucket.
PutBucketWebSite Configures the static website hosting mode for a bucket.
PutLiveChannel Creates a LiveChannel.
PutLiveChannelStatus Configures the status of a LiveChannel.
PutObject Uploads an object.
PutObjectAcl Modifies the ACL of an object.
PutObjectSymlink Creates a symbolic link for an object.
RedirectBucket Redirects a request to a bucket endpoint.
RestoreObject Restores an object.
UploadPart Uploads an object by part.
UploadPartCopy Copies data from an existing object to upload a part.
get_image_exif Queries the EXIF data of an image.
get_image_info Queries the length and width of an image.
get_image_infoexif Queries the length, width, and EXIF data of an image.
get_style Queries a style of a bucket.
list_style Queries all styles of a bucket.
put_style Creates a style for a bucket.