Beginner’s Guide to Calculating Events Per Second (EPS) and Log Storage in Wazuh

Introduction

Monitoring Events Per Second (EPS) and log storage usage in Wazuh is essential for maintaining system performance, storage efficiency, and capacity planning.

A high EPS means your system is processing a large volume of logs, which can impact:

  • Performance – More logs require more processing power and memory.
  • Storage Costs – Storing unnecessary logs increases disk space usage.
  • Query Speed – Too many logs can slow down threat detection queries.

This step-by-step guide will show you how to:
Calculate EPS in Wazuh
Check log storage usage
Optimize Wazuh for performance and scalability

Step 1: Understanding EPS in Wazuh

What is EPS (Events Per Second)?

EPS measures how many security events (logs) Wazuh processes per second.

📌 Why is EPS important?

  • Helps plan for hardware requirements based on log volume.
  • Ensures Wazuh can handle peak log traffic without performance issues.
  • Helps optimize storage retention policies to save disk space.

Step 2: Finding EPS in Wazuh

How Wazuh Stores Logs

Wazuh stores security logs (alerts) in an Elasticsearch index, named wazuh-alerts-*.

  • Each day, Wazuh creates a new index (e.g., wazuh-alerts-2024.10.28).
  • Logs are stored with a timestamp to track when events happened.

Querying Wazuh for Total Events (Alert Logs)

To calculate EPS, we count the total number of events over a specific period (e.g., last 30 days).

📌 Run This Query in Wazuh Dev Tools

For this lab environment, we have used Wazuh Version 4.5 which was used as a plugin for elasticsearch version 7.17.13

1️⃣ Log in to Wazuh Dashboard
2️⃣ Go to “Dev Tools”


3️⃣ Run the following query:

GET wazuh-alerts-*/_count 
{
  "query": {
    "range": {
      "@timestamp": {
        "gte": "now-30d",
        "lt": "now"
      }
    }
  }
}

🔎 Understanding the Query

Query ComponentPurpose
GET wazuh-alerts-*/_countRetrieves the total number of evnts (alerts) stored in Wazuh.
"range": { "@timestamp": { "gte": "now-30d", "lt": "now" }}Filters logs from the last 30 days.
wazuh-alerts-*Ensures logs are counted from all alert indices.

Example Output:

📝 This means Wazuh processed 481,663 events (alert logs) in the last 30 days.

Step 3: Calculating EPS in Wazuh

📌 EPS Formula:

Your Wazuh instance is processing ~0.186 events per second.

Step 4: Checking Log Storage in Wazuh

To ensure your system has enough disk space, check how much storage Wazuh logs are using.

📌 Run This Query to Check Storage Usage

GET _cat/indices/wazuh-alerts-*?bytes=b&h=index,docs.count,store.size

Here is the table format for the output data:

Log File NameLog CountStorage in Bytes
wazuh-alerts-4.x-2025.01.089,0239,748,269
wazuh-alerts-4.x-2025.01.2938,09823,229,776
wazuh-alerts-4.x-2025.01.0715,84711,683,206
wazuh-alerts-4.x-2025.01.2832,75815,665,465
wazuh-alerts-4.x-2025.01.062,7284,310,093
wazuh-alerts-4.x-2025.01.055,7725,806,721
wazuh-alerts-4.x-2025.01.2732,28818,631,653
wazuh-alerts-4.x-2025.01.0914,48612,930,440
wazuh-alerts-4.x-2025.02.0128,49016,037,527
wazuh-alerts-4.x-2025.01.117,3696,720,451
wazuh-alerts-4.x-2025.01.104,2255,915,759
wazuh-alerts-4.x-2025.01.3127,94815,718,149
wazuh-alerts-4.x-2025.01.3031,72920,252,486
wazuh-alerts-4.x-2025.01.151,3022,206,640
wazuh-alerts-4.x-2025.01.146,1885,590,939
wazuh-alerts-4.x-2025.01.134,0495,997,862
wazuh-alerts-4.x-2025.02.0211,39111,192,363
wazuh-alerts-4.x-2025.01.121,6333,084,069
wazuh-alerts-4.x-2025.01.192,0624,295,461
wazuh-alerts-4.x-2025.01.183,6875,015,705
wazuh-alerts-4.x-2025.01.173,6244,097,353
wazuh-alerts-4.x-2025.01.161,6812,918,551
wazuh-alerts-4.x-2025.01.2223,97716,511,122
wazuh-alerts-4.x-2025.01.2125,34917,618,246
wazuh-alerts-4.x-2025.01.2027,70320,215,645
wazuh-alerts-4.x-2025.01.046,3815,024,091
wazuh-alerts-4.x-2025.01.2627,13421,485,830
wazuh-alerts-4.x-2025.01.2533,22220,961,706
wazuh-alerts-4.x-2025.01.031,6302,766,929
wazuh-alerts-4.x-2025.01.023,4686,327,149
wazuh-alerts-4.x-2025.01.2423,91514,835,473
wazuh-alerts-4.x-2025.01.2326,86319,284,282
wazuh-alerts-4.x-2025.01.011,4252,900,703

4.1: Total Storage Calculation in Bytes

To calculate the total storage, first, we need to add up the storage values for each log file in bytes. This gives us the total storage used for all logs over 30 days.

Here’s the storage in bytes for each log:

  • wazuh-alerts-4.x-2025.01.08: 9,748,269 bytes
  • wazuh-alerts-4.x-2025.01.29: 23,229,776 bytes
  • wazuh-alerts-4.x-2025.01.07: 11,683,206 bytes
  • wazuh-alerts-4.x-2025.01.28: 15,665,465 bytes
  • wazuh-alerts-4.x-2025.01.06: 4,310,093 bytes
  • … (and the same for the remaining logs)

Sum of all the log storage

Total Storage=9,748,269+23,229,776+11,683,206+…+2,900,703=358,980,114bytes

So, the total storage used by all logs over 30 days is 358,980,114 bytes.

4.2: Convert Total Storage to MB and GB

Now, let’s convert the total storage from bytes to MB and GB.

  • 1 MB = 1,048,576 bytes
  • 1 GB = 1,073,741,824 bytes

So, the total storage used is 342.75 MB (or 0.334 GB).

4.3: Average Storage per Day Calculation

Next, to find the average storage used per day, we divide the total storage by the number of days (30 days):

So, on average, 11.42 MB (or 0.0111 GB) of storage is used per day.

4.4: Required Storage for 1 Year

To estimate how much storage will be required for one year of log data, we multiply the average storage per day by 365 (the number of days in a year):

4.5: Retention Period for Available Storage

Lastly, let’s calculate how long 100 GB of storage will last with the current log data rate. First, convert 100 GB to bytes:

This means that 100 GB of storage will last for approximately 9 days at the current log data rate.

Summary of Results:

  • Total Storage (for 30 days): 342.75 MB (or 0.334 GB)
  • Average Storage per Day: 11.42 MB (or 0.0111 GB)
  • Required Storage for 1 Year: 4.17 GB
  • Retention Period for 100 GB: Approximately 9 days

This step-by-step calculation shows you how to calculate the storage used by Wazuh logs and how to project future storage requirements.

Step 5: Optimizing EPS and Storage in Wazuh

To prevent performance slowdowns and high storage costs, follow these best practices:

🔹 Reduce EPS and Disk Usage

Enable Log Rotation

  • Automatically delete old logs using Index Lifecycle Management (ILM).

Use Retention Policies

  • Set a policy to keep logs for X days and delete/archive older logs.

Filter Non-Essential Logs

  • Exclude low-priority logs from being indexed.

Optimize Wazuh Indexing

  • Use efficient mappings to reduce disk usage.

Archive Historical Logs

  • Store older logs on external storage (e.g., AWS S3, Azure Blob).

Final Thoughts

What You Learned Today:
✔ How to calculate EPS in Wazuh.
✔ How to check log storage usage.
✔ How to optimize Wazuh for better performance.

Leave a Reply

Your email address will not be published. Required fields are marked *