Learn how to configure and use Server Access Logging.
Server Access Logging provides detailed records for the requests made to a container. Server access logs have many useful applications, such as security and access audits.
Requirements
- An Object Storage container (see our Getting Started with Object Storage guide)
- A user with the required access rights on the bucket
- Have installed and configured aws-cli
Instruction
Create a bucket
Create a logs bucket
Configure bucket acl on logs bucket
Check the bucket ACL configuration
Sample output:
Configure bucket logging parameters
Set the logging parameters for a bucket and specify permissions for who can view and modify the logging parameters.
logging.json
Check bucket logging parameters
Sample output:
View logs
After about one hour, the first logs are available:
Sample output:
Download a log:
Sample output:
Then read it:
Sample output:
The following list describes the log record fields:
- Bucket Owner: canonical user ID of the source bucket
- PROJECT_NAME:USER_NAME
- Bucket: bucket name
- Time: time at which the request was received
- format: [%d/%b/%Y:%H:%M:%S %z]
- Remote IP: apparent internet address of the requester
- Requester: canonical user ID of the requester
- PROJECT_NAME:USER_NAME
- Request ID: identify each request
- ex: txid0123456789abcdef
- Operation: operation listed here is declared
- SOAP.operation
- REST.HTTP_method.resource_type
- WEBSITE.HTTP_method.resource_type
- BATCH.DELETE.OBJECT
- S3.action.resource_type for Lifecycle and logging
- Key: object name
- Request-URI: Request-URI part of the HTTP request message
- HTTP status: numeric HTTP status code of the response
- Error Code: Amazon S3®* Error code
- ex: NoSuchBucket
- Bytes Sent: number of response bytes sent
- Object Size: number of response bytes received?
- Total Time: number of milliseconds the request was in flight from the server's perspective
- Turn-Around Time: TTFB
- Referer: value of the HTTP Referer header
- User-Agent: value of the HTTP User-Agent header
- Version Id: object version ID
- Signature Version: signature version
- SigV2
- SigV4
- Authentication Type: type of request authentication used
- AuthHeader
- QueryString
- Host Header: endpoint used to connect to S3™
- (BUCKET.)STORAGE_DOMAIN
Check log file acl
Sample output:
Disable Server Access Logging
Create an empty configuration file:
Then configure bucket logging parameters with this empty configuration file:
Go further
For more information and tutorials, please see our other Object Storage support guides or explore the guides for other OVHcloud products and services.
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.
*S3 is a trademark filed by Amazon Technologies, Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies, Inc.