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

OSS log types

Log type Description
Access logs Records access to OSS buckets. Access logs are collected in real time.
Batch deletion logs Records information about deleted objects. Batch deletion logs are collected in real time.
Note When you call the DeleteObjects API operation, a request record is generated in an access log.
Hourly metering logs Records hourly metering statistics in a specific bucket to support data analysis. Logs are collected several hours after they are generated.

OSS built-in logging and OSS logging in Log Service

OSS provides the log query feature of Log Service. If you enable the feature, Log Service collects OSS access logs, batch deletion logs, and hourly metering logs of OSS. You can use this feature to query the logs in the OSS console in real time. OSS built-in logging is a built-in feature of OSS. This feature records and stores the access logs of OSS.

OSS logs recorded in Log Service contain all information about the operations performed on OSS. These logs have different log fields from OSS access logs that are recorded in OSS. For more information about OSS log fields, see Access logs.
Field of OSS logs recorded in OSS Field of OSS 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 entry. Valid value: oss_access_log.
acc_access_region For a transfer acceleration request, this field is the ID of the region where the requested access point resides. Otherwise, the value of this field is a hyphen (-).
access_id The AccessKey ID that is used to access OSS.
bucket The name of the OSS bucket.
bucket_location The ID of the region where the OSS bucket resides. The value is in the oss-<region ID> format.
bucket_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
client_ip The IP address of the request initiator. The IP address can be the IP address of the client, firewall, or proxy.
content_length_in The value of the Content-Length request header field. Unit: bytes.
content_length_out The value of the Content-Length response header field. Unit: bytes.
delta_data_size The size change 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 returned by OSS. For more information, see OSS error response.
host The domain name of the requested OSS bucket, for example, bucket123.oss-cn-beijing.aliyuncs.com.
http_method The HTTP request method.
http_status The HTTP status code.
http_type The protocol of the HTTP request. Valid values: HTTP and HTTPS.
logging_flag Indicates whether the feature that periodically exports logs to an OSS bucket is enabled. A value of true indicates that the feature is enabled.
object The requested URL-encoded object. You can use the select url_decode(object) statement to decode the object during log queries.
object_size The size of the OSS 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 HTTP request referer, for example, http://www.abc.com.
request_id The ID of the request.
request_length The size of the HTTP request message. Unit: bytes.
request_uri The URL-encoded URI of a request, including the query-string parameter. You can use the select url_decode(request_uri) statement to decode the URI during log queries.
requester_id The ID of the Alibaba Cloud account that is used to initiate the API request. If a user anonymously initiates a request, the value of this field is a hyphen (-).
response_body_length The size of the HTTP response body. Unit: bytes.
response_time The HTTP response time.
server_cost_time The time 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 the Authorization header field.
  • UriSign: The request is signed by using the request URL.
  • AdminSign: The request is signed by using the administrator account.
sync_request The type of the request. Valid values:
  • hyphen (-): general request
  • cdn: CDN back-to-origin request
  • superuser: request initiated by the superuser
  • sync: synchronization request
  • sync-public: cross-region replication request
time The time when OSS receives the request, for example, 27/Feb/2018:13:58:45. If you need a timestamp, you can use the __time__ field.
user-agent The User-Agent HTTP header field of the request, for example, curl/7.15.5.
vpc_addr The IP address of the server in the VPC that stores the OSS bucket.
vpc_id The ID of the VPC where the requested OSS bucket resides.

Batch deletion logs

When you call the DeleteObjects API operation, a request record is generated in an access log. The information about the objects that you request to delete is stored in the HTTP request body. The information about an object is not recorded in the object field in the access log. The value of this field is a hyphen (-). To retrieve the information about deleted objects, check the corresponding batch deletion log. The following table lists the fields and descriptions of batch deletion logs. You can use the request_id parameter to associate the batch deletion request with the objects that you want to delete.

Field Description
__topic__ The topic of the log entry. Valid value: oss_batch_delete_log.
client_ip The IP address of the request initiator. The IP address can be the IP address of the client, firewall, or proxy.
user_agent The User-Agent HTTP header field of the request, for example, curl/7.15.5.
bucket The name of the OSS bucket.
error_code The error code returned by OSS. For more information, see OSS error response.
request_length The size of the HTTP request message. Unit: bytes.
response_body_length The size of the HTTP response body. Unit: bytes.
object The requested URL-encoded object. You can use the select url_decode(object) statement to decode the object during log queries.
object_size The size of the OSS object. Unit: bytes.
operation The API operation. For more information, see API operations.
bucket_location The ID of the region where the OSS bucket resides. The value is in the oss-<region ID> format.
http_method The HTTP request method, such as POST.
referer The HTTP request referer, for example, http://www.abc.com.
request_id The ID of the request.
http_status The HTTP status code.
sync_request The type of the request. Valid values:
  • hyphen (-): general request
  • cdn: CDN back-to-origin request
  • superuser: request initiated by the superuser
  • sync: synchronization request
  • sync-public: cross-region replication request
request_uri The URL-encoded URI of a request, including the query-string parameter. You can use the select url_decode(request_uri) statement to decode the URI during log queries.
host The domain name of the requested OSS bucket, for example, bucket123.oss-cn-beijing.aliyuncs.com.
logging_flag Indicates whether the feature that periodically exports logs to an OSS bucket is enabled. A value of true indicates that the feature is enabled.
server_cost_time The time 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 Alibaba Cloud account that is used to initiate the API request. If a user anonymously initiates a request, the value of this field is a hyphen (-).
delta_data_size The size change of the object. The value of this field is 0 if the object size does not change. The value of this field is a hyphen (-) if the request is not an upload request.

Hourly metering logs

Hourly metering logs record hourly metering statistics in a specific bucket to support analysis.

Field Description
__topic__ The topic of the log entry. Valid value: 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 of CDN. Unit: bytes.
cdn_out The outbound traffic of CDN. Unit: bytes.
get_request The number of GET requests.
intranet_in The inbound traffic from the internal network. Unit: bytes.
intranet_out The outbound traffic from the internal network. Unit: bytes.
network_in The inbound traffic from the external network. Unit: bytes.
network_out The outbound traffic from the external network. 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 storage capacity of the OSS Bucket. Unit: bytes.
metering_datasize The size of metering data of non-Standard OSS buckets.
process_img_size The size of a processed image file. Unit: bytes.
process_img The information about the processed image.
sync_in The synchronous inbound traffic. Unit: bytes.
sync_out The synchronous outbound traffic. Unit: bytes.
start_time The time when a metering operation starts. The time is in the UNIX timestamp format.
end_time The time when a metering operation ends. The time is in the UNIX timestamp format.
region The ID of the region where the OSS bucket resides.
bucket_location The ID of the region where the OSS bucket resides. The value is in the oss-<region ID> format.

API operations

The following table lists the API operations that you can call on OSS. For more information, see API overview.

Operation Description
AbortMultiPartUpload Stops a multipart upload.
AppendObject Appends an OSS object.
CommitTransition Commits a transition.
CompleteUploadPart Completes a multipart upload.
CopyObject Copies an OSS object.
DeleteBucket Deletes an OSS bucket.
DeleteLiveChannel Deletes a LiveChannel.
DeleteObject Deletes an OSS object.
DeleteObjects Deletes multiple objects.
ExpireObject Makes an OSS object expire.
GetBucket Queries the objects of an OSS bucket.
GetBucketAcl Obtains permissions to access an OSS bucket.
GetBucketCors Queries the cross-origin resource sharing (CORS) rules of an OSS bucket.
GetBucketEventNotification Queries the notification configurations of an OSS bucket.
GetBucketInfo Queries the information about an OSS bucket.
GetBucketLifecycle Queries the lifecycle configurations of an OSS bucket.
GetBucketLocation Queries the region where an OSS bucket resides.
GetBucketLog Queries the access log configurations of an OSS bucket.
GetBucketReferer Queries the hotlink protection configurations of an OSS bucket.
GetBucketReplication Queries the cross-region replications of an OSS bucket.
GetBucketReplicationProgress Queries the progress of a cross-region replication.
GetBucketStat Queries the information about an OSS bucket.
GetBucketWebSite Queries the static website hosting status of an OSS bucket.
GetLiveChannelStat Queries the status of a LiveChannel.
GetObject Reads an OSS object.
GetObjectAcl Obtains the Access Control List (ACL) of an OSS object.
GetObjectInfo Queries the information about an OSS object.
GetObjectMeta Queries the metadata of an OSS object.
GetObjectSymlink Queries the details of the OSS object to which a symbolic link is referenced.
GetPartData Queries the data in all parts of an OSS object.
GetPartInfo Queries the information about all parts of an OSS object.
GetProcessConfiguration Queries the image processing configurations of an OSS bucket.
GetService Queries OSS buckets.
HeadBucket Queries the information about an OSS bucket.
HeadObject Queries the information about an OSS object.
InitiateMultipartUpload Initializes the multipart upload for an OSS object.
ListMultiPartUploads Queries multipart upload events.
ListParts Queries the status of all parts of an OSS object.
Options
PostObject Uploads an OSS object by using a form.
PostProcessTask Commits data processing operations, such as taking screenshots.
PostVodPlaylist Creates a video-on-demand (VOD) playlist of a LiveChannel.
ProcessImage Processes an image.
PutBucket Creates an OSS bucket.
PutBucketCors Specifies the CORS rule for an OSS bucket.
PutBucketLifecycle Specifies the lifecycle configuration of an OSS bucket.
PutBucketLog Specifies the access log for an OSS bucket.
PutBucketWebSite Specifies static website hosting mode for an OSS bucket.
PutLiveChannel Creates a LiveChannel.
PutLiveChannelStatus Specifies the status of a LiveChannel.
PutObject Uploads an OSS object.
PutObjectAcl Modifies the ACL of an OSS object.
PutObjectSymlink Creates an OSS object by using a symbolic link.
RedirectBucket Redirects the request to an OSS bucket endpoint.
RestoreObject Restores an OSS object.
UploadPart Resumes uploading an OSS object from a checkpoint.
UploadPartCopy Copies a part.
get_image_exif Queries the exchangeable image file format (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 an OSS bucket.
list_style Queries all styles of an OSS bucket.
put_style Creates a style for an OSS bucket.