10.4. Bucket logging for Multicloud Object Gateway


Bucket logging helps you to record the S3 operations that are performed against the Multicloud Object Gateway (MCG) bucket for compliance, auditing, and optimization purposes.

Bucket logging supports the following two options:

  • Best-effort - Bucket logging is recorded using UDP on the best effort basis
  • Guaranteed - Bucket logging with this option creates a PVC attached to the MCG pods and saves the logs to this PVC on a Guaranteed basis, and then from the PVC to the log buckets. Using this option logging takes place twice for every S3 operation as follows:

    • At the start of processing the request
    • At the end with the result of the S3 operation

10.4.1. Enabling bucket logging for Multicloud Object Gateway using the Best-effort option

Prerequisites

Procedure

  1. Create a data bucket where you can upload the objects.

    nb bucket create data.bucket
  2. Create a log bucket where you want to store the logs for bucket operations by using the following command:

    nb bucket create log.bucket
  3. Configure bucket logging on data bucket with log bucket in one of the following ways:

    • Using the NooBaa API

      nb api bucket_api put_bucket_logging '{
         "name": "data.bucket",
         "log_bucket": "log.bucket",
         "log_prefix": "data-bucket-logs"
      }'
    • Using the S3 API

      alias s3api_alias='AWS_ACCESS_KEY_ID=$NOOBAA_ACCESS_KEY AWS_SECRET_ACCESS_KEY=$NOOBAA_SECRET_KEY aws --endpoint https://localhost:10443 --no-verify-ssl s3api'
      1. Create a file called setlogging.json in the following format:

        {
          "LoggingEnabled": {
             "TargetBucket": "<log-bucket-name>",
             "TargetPrefix": "<prefix/empty-string>"
          }
        }
      2. Run the following command:

        s3api_alias put-bucket-logging --endpoint <ep> --bucket <source-bucket> --bucket-logging-status file://setlogging.json --no-verify-ssl
  4. Verify if the bucket logging is set for the data bucket in one of the following ways:

    • Using the NooBaa API

      nb api bucket_api get_bucket_logging '{
         "name": "data.bucket"
      }'
    • Using the S3 API

      s3api_alias get-bucket-logging --no-verify-ssl --endpoint <ep> --bucket <source-bucket>

      The S3 operations can take up to 24 hours to get recorded in the logs bucket. The following example shows the recorded logs and how to download them:

      Example

      s3_alias cp s3://logs.bucket/data-bucket-logs/logs.bucket.bucket_data-bucket-logs_1719230150.log - | tail -n 2
      
      Jun 24 14:00:02 10-XXX-X-XXX.sts.openshift-storage.svc.cluster.local  {"noobaa_bucket_logging":"true","op":"GET","bucket_owner":"operator@noobaa.io","source_bucket":"data.bucket","object_key":"/data.bucket?list-type=2&prefix=data-bucket-logs&delimiter=%2F&encoding-type=url","log_bucket":"logs.bucket","remote_ip":"100.XX.X.X","request_uri":"/data.bucket?list-type=2&prefix=data-bucket-logs&delimiter=%2F&encoding-type=url","request_id":"luv2XXXX-ctyg2k-12gs"} Jun 24 14:00:06 10-XXX-X-XXX.s3.openshift-storage.svc.cluster.local  {"noobaa_bucket_logging":"true","op":"PUT","bucket_owner":"operator@noobaa.io","source_bucket":"data.bucket","object_key":"/data.bucket/B69EC83F-0177-44D8-A8D1-4A10C5A5AB0F.file","log_bucket":"logs.bucket","remote_ip":"100.XX.X.X","request_uri":"/data.bucket/B69EC83F-0177-44D8-A8D1-4A10C5A5AB0F.file","request_id":"luv2XXXX-9syea5-x5z"}

  5. (Optional) To disable bucket logging, use the following command:

    nb api bucket_api delete_bucket_logging '{
       "name": "data.bucket"
    }'

10.4.2. Enabling bucket logging using the Guaranteed option

Procedure

  • Enable Guaranteed bucket logging using the NooBaa CR in one of the following ways:

    • Using the default CephFS storage class update the NooBaa CR spec:

      bucketLogging:
      {
      loggingType: guaranteed
      }
    • Using the RWX PVC that you created:

      注記

      Make sure that the PVC supports RWX

      bucketLogging:
      {
      loggingType: guaranteed
      bucketLoggingPVC: <pvc-name>
      }
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る