Managing Access Logs

The bucket logging function enables bucket owners to obtain access data of their own buckets. For example, a user opens his or her bucket for all people to download the network resources in the bucket, and the user wants to obtain information such as download trends of files and the request sources. The bucket logging records requesters' information and request parameters and saves them as the objects to a target bucket, enabling the bucket owner to collect statistics.

The bucket logging enables OBS to generate log objects in the background. To obtain permissions to write logs in the target bucket, you must grant the WRITE and READ_ACP permissions of the target bucket to the log delivery user group.

The bucket owner has the FULL_CONTROL permission for all generated bucket logs. The bucket owner can configure access control parameters to grant other users permission to access bucket logs. Users granted the access permission can access the bucket logs that are generated after the permission takes effect and before the permission is canceled.

The following shows the access log of the target bucket:

3ebc47240f7640e4b6c4b33937dd9b58 hw203 [15/Jun/2015:06:38:27 +0000] 1192.168.0.1 3ebc47240f7640e4b6c4b33937dd9b58 A196564DC12F13AAA19FD56D23B04C58 REST.GET.BUCKET - "GET /hw203 HTTP/1.1" 200 - 247 - 58 58 "-" "curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8^? zlib/1.2.3 libidn/1.10" – 
3ebc47240f7640e4b6c4b33937dd9b58 hw203 [15/Jun/2015:06:38:28 +0000] 1192.168.0.1 3ebc47240f7640e4b6c4b33937dd9b58 2CFE324941EE96DDDD41F5FE57B369DD REST.GET.BUCKET - "GET /hw203 HTTP/1.1" 200 - 247 - 39 39 "-" "curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8 zlib/1.2.3 libidn/1.10" - 
3ebc47240f7640e4b6c4b33937dd9b58 hw203 [15/Jun/2015:06:38:29 +0000] 1192.168.0.1 3ebc47240f7640e4b6c4b33937dd9b58 175189E1217733A1F41F4060DF2E7268 REST.GET.BUCKET - "GET /hw203 HTTP/1.1" 200 - 247 - 22 22 "-" "curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8^? zlib/1.2.3 libidn/1.10" – 
3ebc47240f7640e4b6c4b33937dd9b58 hw203 [15/Jun/2015:06:38:30 +0000] 1192.168.0.1 3ebc47240f7640e4b6c4b33937dd9b58 0F1A4E95C42D7A491D8868CD040DD2EB REST.GET.BUCKET - "GET /hw203 HTTP/1.1" 200 - 247 - 33 33 "-" "curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8 zlib/1.2.3 libidn/1.10" - 
3ebc47240f7640e4b6c4b33937dd9b58 hw203 [15/Jun/2015:06:39:14 +0000] 1192.168.0.1 3ebc47240f7640e4b6c4b33937dd9b58 C09CD463EC71251C41B58F389094168B REST.GET.BUCKET - "GET /hw203 HTTP/1.1" 200 - 247 - 21 21 "-" "curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8 zlib/1.2.3 libidn/1.10" – 

The access log of each bucket contains the information listed in the following table:

Table 1 Bucket logging format

Parameter

Example Value

Description

BucketOwner

3ebc47240f7640e4b6c4b33937dd9b58

ID of the bucket owner

Bucket

hw203

Bucket name

Time

[15/Jun/2015:06:38:27 +0000]

Request timestamp

Remote IP

192.168.0.1

Request IP address

Requester

3ebc47240f7640e4b6c4b33937dd9b58

Requester ID

RequestID

175189E1217733A1F41F4060DF2E7268

Request ID

Operation

REST.GET.BUCKET

Operation name

Key

phtoto.gif

Object name

Request-URI

"GET /hw203 HTTP/1.1"

Request URI

HTTPStatus

200

Returned code

ErrorCode

NoSuchBucket

Error code

BytesSent

555

Size of the HTTP response, expressed in bytes

ObjectSize

400

Object size

TotalTime

58

Server processing time (millisecond)

Turn-AroundTime

58

Total request time (millisecond)

Referrer

"http://example.com"

Request referrer header

User-Agent

"curl/7.19.0"

Request user-agent header

Version Id

25HXDUX78WEUU367

Version ID contained in a request

For details, see section PUT Bucket logging in the OBS API Reference.

Registration