Calculating Ingress and Egress Utilization Using Bucket Logs

Prev Next

You can generate a daily report of ingress (uploaded) and egress (downloaded/listed) bytes in Wasabi Object Storage by processing S3 bucket access logs with Python. These instructions are designed for users familiar with the AWS CLI, Wasabi, and basic scripting.

Prerequisites

Before beginning,  be sure the following requirements are met:

Script Executions and Details

Follow the steps below to calculate daily ingress and egress bytes using the provided Python script. Optionally, you can create cron jobs to run this script and automate the daily report generation.

The accuracy of ingress and egress bytes and TB depends directly on the availability and logging of the bucket logs. Bucket logging is an essential prerequisite. Without consistent and correct log files, the report output may be incomplete or inaccurate. For reliable monitoring, always verify that bucket logging is enabled for every source bucket and that logs are being saved to a dedicated, centralized logging bucket.

  1. Prepare the environment.  

  2. Download the script. Use the provided Python script (wasabi_ingress_egress.py) for log analysis.  

    wasabi_ingress_egress.py

  3. Run the script.  

    • Save the script as wasabi_ingress_egress.py.

    • From the command line, navigate to the folder containing the script and run:

    python3 wasabi_ingress_egress.py --logging-bucket <log_bucket_name> --region <Logging_bucket_region> --profile <aws_profile>
    

    Screenshot 2025-09-08 125716.png

    If parameters are omitted in the command, the script will prompt for them interactively.

    python3 wasabi_ingress_egress.py
    

    Screenshot 2025-09-08 124910.png

    Output will be a CSV file summarizing ingress and egress per bucket for the current day.

Output Example

date_local

bucket

total_ingress_bytes

total_ingress_tb

total_egress_bytes

total_egress_tb

9/8/2025

test-olue1

124565

0

1209462790553.6

1.21

Script Overview

The script processes each log file in the logging bucket for today and:

  • Identifies upload operations (PUT/POST/MULTIPART) to measure ingress bytes.

  • Identifies GET (downloads) and LIST operations to measure egress bytes.

  • Outputs total ingress and egress in Bytes and TB per bucket into a CSV report.

Verifying and Next Actions

  • Inspect the generated CSV to confirm that the data matches the expected operations.

  • If log files are missing, verify bucket logging settings.

  • For billing or compliance inquiries, contact Wasabi Support referencing this report.