Tutorial: Accessing Logs From A Bucket
After granting yourself read access, you can retrieve your cluster’s audit and infrastructure logs directly from the OOS bucket where they are stored. These buckets contain timestamped log files that record Kubernetes API activity and infrastructure events for your cluster.
This tutorial explains how to access the OOS bucket and download log files using S3-compatible commands. You will first learn how to list available logs in your bucket, then how to download a specific log file to your local environment.
Accessing Logs from OOS Bucket
The following procedures describe how to list the available log files in your OOS bucket and download a specific log to your local system.
Before you begin: Ensure that you have both:
|
Listing Available Logs In Your OOS Bucket
To download a log file, you need to first identify its exact object key by listing the contents of your audit or IaaS bucket. You can do so using any S3-compatible command. For more information, see Listing the Objects of a Bucket.
Listing Available Logs In Your OOS Bucket Using s3
Use the ls command to list available logs in your bucket:
$ aws s3 ls s3://YOUR_BUCKET \
--endpoint https://oos.eu-west-2.outscale.com
The ls command returns a list of objects, including their key.
Listing Available Logs In Your OOS Bucket Using s3api
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
Use the list-objects-v2 command to list available logs in your bucket:
$ aws s3api list-objects-v2 \
--bucket YOUR_BUCKET \
--endpoint https://oos.eu-west-2.outscale.com
The list-objects-v2 command returns a list of objects, including their key.
Downloading My Log File
Once your OUTSCALE account ID is added to the readers list of the OOSAccess object, that account is automatically granted read-only permissions on the underlying OOS buckets storing the logs of your cluster. You can then retrieve these logs directly from the OOS bucket using s3-compatible commands. For more information, see Downloading an Object from a Bucket.
Downloading My Log File Using s3
To download your log file from a bucket, use the cp command following this syntax:
$ aws s3 cp s3://YOUR_BUCKET/YOUR_OBJECT PATH/TO/FILE \
--endpoint https://oos.eu-west-2.outscale.com
This command contains the following options that you need to specify:
-
s3://YOUR_BUCKET/YOUR_OBJECT: The name of the cluster’s audit or IaaS log bucket and the name of the log file you want to download. -
PATH/TO/FILE: The path to the location where you want the object to be downloaded. -
endpoint: The OOS endpoint matching your cluster’s Region.
Downloading My Log File Using s3api
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
Use the get-object command to download your log file from the OOS bucket:
$ aws s3api get-object \
--bucket YOUR_BUCKET \
--key OBJECT \
outfile=<~/home/Name_Of_The_Downloaded_Object> \
--endpoint https://oos.eu-west-2.outscale.com
This command contains the following options that you need to specify:
-
bucket: The name of the cluster’s audit or IaaS log bucket. -
key: The name of the log file you want to download. -
outfile: The name for the log file once downloaded on your machine. This name can be a path. -
endpoint: The OOS endpoint matching your cluster’s Region.
Related Pages
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.