As your Wazuh deployment grows, so does the volume of security events it generates.
Authentication logs, file integrity monitoring alerts, vulnerability scan results, endpoint telemetry, and network events quickly accumulate into millions of documents stored within the Wazuh Indexer.
Without a structured lifecycle strategy, these indexes consume valuable disk space, degrade search performance, and increase operational complexity.
This is where Wazuh Index State Management (ISM) becomes essential.
Index State Management (ISM) is an OpenSearch feature that automatically manages indexes throughout their lifecycle using predefined policies.
Instead of manually deleting old indexes or constantly monitoring disk usage, administrators can define rules that transition indexes through different states based on age, size, or other conditions.
ISM can automatically roll over active indexes, optimize older ones, move them to lower-cost storage, and eventually delete them when they are no longer needed.
For security operations teams, automating index management provides several important benefits:
- Prevents storage from filling unexpectedly
- Improves dashboard responsiveness by limiting active indexes
- Reduces administrative effort
- Ensures retention policies are enforced consistently
- Helps maintain a healthy and scalable Wazuh deployment
Whether you’re managing a small lab environment or an enterprise SIEM collecting billions of events, implementing ISM is one of the most effective ways to keep your Wazuh infrastructure efficient and reliable.
In this guide, you’ll learn:
- How Wazuh Index State Management works
- How ISM integrates with the Wazuh Indexer
- The lifecycle states used by OpenSearch
- How to create and apply ISM policies
- Best practices for retention, rollover, and deletion
- Common mistakes to avoid when managing Wazuh indexes
You’ll also learn how ISM complements broader index optimization strategies discussed in How to Design a Wazuh OpenSearch Shard Allocation Strategy and How to Configure Wazuh Log Retention.
For readers unfamiliar with the underlying storage engine, OpenSearch’s official documentation provides an excellent overview of Index State Management.
What Is Wazuh Index State Management (ISM)?
Wazuh Index State Management (ISM) is the process of automatically controlling how indexes are created, maintained, optimized, and eventually deleted throughout their lifecycle.
Rather than relying on administrators to manually monitor index growth, ISM applies predefined policies that execute actions when specific conditions are met.
Since the Wazuh Indexer is built on OpenSearch, it inherits OpenSearch’s native ISM framework.
Every security event collected by Wazuh is stored inside OpenSearch indexes, making ISM a core feature for maintaining long-term performance and storage efficiency.
Definition of Index State Management
Index State Management is a policy-driven lifecycle automation framework that manages indexes based on configurable states and transitions.
Each policy consists of one or more states such as:
- Hot (actively receiving data)
- Warm (less frequently accessed)
- Cold (archival storage)
- Delete (remove permanently)
Within each state, OpenSearch performs automated actions such as:
- Rolling over indexes
- Reducing replica counts
- Allocating indexes to different nodes
- Force-merging segments
- Applying read-only settings
- Deleting expired indexes
Instead of scheduling manual maintenance tasks, administrators simply attach an ISM policy to an index pattern and allow OpenSearch to handle the lifecycle automatically.
How ISM Works Within OpenSearch
OpenSearch continuously evaluates indexes against the conditions defined in an ISM policy.
A typical lifecycle might look like this:
- A new Wazuh alerts index is created.
- The index remains in the Hot state while actively receiving security events.
- After reaching a specified age or size, OpenSearch automatically rolls over to a new index.
- Older indexes transition to a Warm state where they are optimized for storage efficiency.
- After the retention period expires, OpenSearch deletes the index automatically.
This event-driven automation eliminates the need for scheduled scripts or manual cleanup.
According to the OpenSearch documentation, ISM policies are evaluated regularly by the background policy engine, allowing lifecycle transitions to occur without administrator intervention.
Difference Between Manual Index Management and Automated Lifecycle Policies
Without ISM, administrators are responsible for tasks such as:
- Monitoring index sizes
- Creating new indexes
- Deleting old indexes
- Managing disk utilization
- Optimizing search performance
- Enforcing retention requirements
These manual processes are time-consuming and prone to human error.
With ISM, these operations become automated through lifecycle policies.
| Manual Management | Index State Management |
|---|---|
| Manual index cleanup | Automatic deletion |
| Manual rollover | Automatic rollover |
| Constant storage monitoring | Policy-driven storage optimization |
| Scheduled maintenance scripts | Built-in lifecycle automation |
| Inconsistent retention | Consistent policy enforcement |
| Higher administrative workload | Minimal ongoing management |
For environments producing continuous security telemetry, automation significantly reduces operational overhead while improving reliability.
Relationship Between Wazuh Indexer and OpenSearch ISM
The Wazuh Indexer is an OpenSearch-based search and analytics engine responsible for storing all indexed security data.
Because Wazuh Indexer uses OpenSearch internally, ISM is not a separate Wazuh feature, it is an OpenSearch capability used to manage Wazuh indexes.
This means administrators can apply ISM policies to indexes such as:
wazuh-alerts-*wazuh-archives-*wazuh-monitoring-*- Custom security indexes
Understanding this relationship is important because many performance tuning recommendations for OpenSearch also apply directly to Wazuh deployments.
Readers interested in index architecture should also see How to Build a Wazuh Indexer Cluster and The Complete Wazuh Cluster Architecture Guide.
Why Use Index State Management in Wazuh?
Security monitoring platforms continuously ingest massive amounts of log data.
Without lifecycle automation, storage usage grows indefinitely, queries become slower, and administrators spend increasing amounts of time performing maintenance.
Index State Management addresses these challenges by automating the lifecycle of every Wazuh index.
Reduce Storage Costs
Security logs accumulate rapidly.
A medium-sized environment can generate hundreds of gigabytes, or even terabytes, of indexed data each month.
Rather than storing every index on expensive high-performance disks, ISM enables organizations to:
- Delete obsolete indexes automatically
- Move older data to lower-cost storage tiers
- Reduce replica counts for archival indexes
- Optimize storage utilization
These capabilities help organizations significantly lower infrastructure costs while preserving data for the required retention period.
Improve Search Performance
Search performance depends heavily on the number and size of active indexes.
When clusters retain thousands of aging indexes, search operations require additional resources, increasing latency for dashboards and investigations.
ISM improves search responsiveness by:
- Keeping active indexes appropriately sized
- Rolling over large indexes automatically
- Removing obsolete indexes
- Optimizing older indexes through force merge operations
This allows investigators to query recent security events more efficiently while historical data remains available when needed.
Automate Index Lifecycle Management
One of ISM’s greatest advantages is complete lifecycle automation.
Instead of relying on cron jobs or manual maintenance windows, administrators define policies once and allow OpenSearch to enforce them automatically.
Typical automated actions include:
- Rollover after 50 GB
- Transition after 30 days
- Force merge after rollover
- Reduce replicas after 60 days
- Delete after 180 days
Automation reduces configuration drift and ensures every index follows the same lifecycle.
Prevent Disk Space Exhaustion
One of the most common causes of Wazuh Indexer failures is running out of available disk space.
When storage reaches critical thresholds, OpenSearch may:
- Block writes
- Reject new indexes
- Mark shards as read-only
- Trigger cluster health warnings
ISM helps prevent these situations by continuously removing expired indexes before storage reaches dangerous levels.
If you’re already experiencing storage-related issues, see How to Fix a Yellow Cluster Status in Wazuh Indexer and How to Tune OpenSearch Heap Size to Stop Wazuh High Memory Crashes.
Simplify Compliance Retention Policies
Many regulatory frameworks require organizations to retain security logs for specific periods.
Examples include:
- PCI DSS
- HIPAA
- SOX
- GDPR
- ISO 27001
Rather than manually tracking retention dates, ISM enforces policies consistently across every index.
For example:
- Keep authentication logs for 365 days
- Retain vulnerability scan results for one year
- Delete endpoint telemetry after 180 days
Automated enforcement reduces compliance risk while eliminating manual record management.
The U.S. National Institute of Standards and Technology (NIST) emphasizes the importance of establishing and enforcing log retention policies as part of an organization’s security monitoring program.
Reduce Administrative Overhead
Manual index management becomes increasingly difficult as environments scale.
Administrators no longer need to:
- Monitor every index daily
- Schedule cleanup jobs
- Delete indexes manually
- Estimate storage consumption continuously
- Create custom maintenance scripts
Instead, lifecycle policies execute automatically in the background.
This allows security teams to spend more time investigating threats and improving detection capabilities rather than performing routine maintenance.
As OpenSearch creator Shay Banon has long advocated through the evolution of Elasticsearch and OpenSearch ecosystems, automating operational workflows is a key principle for building scalable, resilient search infrastructures.
Automating index lifecycle management follows this principle by reducing repetitive operational tasks while improving cluster stability.
How Wazuh Indexes Are Organized
Before configuring Index State Management (ISM), it’s important to understand how Wazuh organizes its indexed data.
Different types of information are stored in separate indexes, allowing administrators to apply lifecycle policies based on the value and retention requirements of each dataset.
Rather than treating all security data equally, Wazuh separates alerts, archived logs, monitoring information, and internal operational data into distinct index patterns.
This makes it possible to retain critical security alerts for longer periods while deleting less valuable operational data sooner.
Alerts Indexes
Alerts indexes contain the security events generated after Wazuh processes incoming logs through its decoders and rules.
These indexes typically include:
- Authentication failures
- Malware detections
- File Integrity Monitoring (FIM) alerts
- Vulnerability detection events
- Active Response executions
- Compliance violations
- Threat intelligence matches
- Custom detection rule alerts
For most deployments, alerts indexes are the primary source of information used during threat hunting, incident response, and dashboard visualization.
Because alerts are accessed frequently, they generally remain in the Hot state longer than other indexes before transitioning to less expensive storage tiers.
If you’re unfamiliar with how alerts are generated, see How to Create Custom Detection Rules in Wazuh (With Examples) and How to Test Wazuh Rules.
Archives Indexes
Archive indexes store the original log events received by Wazuh before correlation and rule evaluation.
Unlike alerts, archived logs often contain:
- Raw syslog messages
- Windows Event Logs
- Linux audit logs
- Application logs
- Firewall logs
- Cloud service logs
Since archive data is significantly larger than alert data, it usually consumes the majority of available storage in large deployments.
Many organizations apply shorter retention periods to archive indexes or transition them to lower-cost storage after a few weeks.
For organizations using archives for forensic investigations, retention policies should align with business and regulatory requirements.
Monitoring Indexes
Monitoring indexes collect operational metrics about the Wazuh platform itself.
Examples include:
- Cluster health
- Node statistics
- JVM usage
- CPU utilization
- Memory consumption
- Disk usage
- Indexing performance
These indexes help administrators monitor the health of the Wazuh Indexer cluster and troubleshoot infrastructure issues.
Since monitoring data loses value relatively quickly, organizations often configure shorter retention periods than those used for security alerts.
Readers interested in performance tuning should also review Step-by-Step Wazuh Manager Scaling Guide and How to Build a Wazuh Indexer Cluster.
Statistics and Internal Indexes
Wazuh and OpenSearch also maintain several internal indexes used for platform functionality.
These may include:
- Dashboard configuration data
- Saved searches
- Visualizations
- User settings
- Security configuration
- Index management metadata
- System statistics
Unlike alerts or archives, these indexes should generally not be managed with aggressive deletion policies.
Accidentally deleting internal indexes can lead to:
- Missing dashboards
- Lost visualizations
- Broken authentication
- Cluster management issues
Always verify an index’s purpose before applying lifecycle policies.
Daily vs. Rollover Index Patterns
Historically, many Wazuh deployments created a new index every day using date-based naming conventions such as:
wazuh-alerts-4.x-2026.07.24This approach simplifies retention because administrators can delete indexes based on the date embedded in the name.
Modern OpenSearch deployments increasingly favor rollover indexes, where a new index is created only after meeting predefined thresholds, such as:
- Maximum age
- Maximum size
- Maximum document count
For example:
wazuh-alerts-000001
wazuh-alerts-000002
wazuh-alerts-000003Rollover patterns generally produce more consistent shard sizes, improve cluster balance, and work seamlessly with ISM policies.
For additional guidance on shard sizing, see How to Design a Wazuh OpenSearch Shard Allocation Strategy.
Index Templates and Aliases
Index templates ensure that newly created indexes inherit consistent settings.
Templates typically define:
- Number of primary shards
- Replica count
- Index mappings
- Analysis settings
- ISM policy assignment
- Rollover alias
Aliases provide a stable name that applications query regardless of which physical index currently receives writes.
For example:
Alias:
wazuh-alerts
Current write index:
wazuh-alerts-000014When a rollover occurs, OpenSearch automatically updates the alias to point to the new write index, allowing Wazuh to continue indexing data without configuration changes.
OpenSearch recommends using templates together with rollover aliases because they enable fully automated lifecycle management.
How Wazuh Index State Management Works
Index State Management operates through a series of policies that evaluate indexes and automatically perform lifecycle operations based on predefined rules.
Rather than relying on scheduled scripts or manual administration, ISM continuously checks indexes and determines whether they should transition to a new lifecycle state.
Understanding the core components of ISM makes policy creation much easier.
States
A state represents a stage in an index’s lifecycle.
Common lifecycle states include:
- Hot
- Warm
- Cold
- Delete
Each state serves a specific purpose.
For example:
| State | Purpose |
|---|---|
| Hot | Active indexing and frequent searches |
| Warm | Less frequent access with optimized storage |
| Cold | Long-term retention on lower-cost infrastructure |
| Delete | Permanent removal after retention expires |
An index remains in a state until its transition conditions are satisfied.
Actions
Actions define the operations OpenSearch performs while an index resides in a particular state.
Common ISM actions include:
- Rollover
- Read-only
- Force merge
- Replica reduction
- Allocation
- Notification
- Snapshot (if integrated with snapshot workflows)
- Delete
For example, a Hot state might:
- Accept writes
- Roll over after 50 GB
A Warm state might:
- Make the index read-only
- Force merge segments
- Reduce replicas
Each action is executed automatically according to the assigned policy.
Conditions
Conditions determine when actions or transitions occur.
Common conditions include:
- Index age
- Index size
- Document count
- Time since rollover
Examples:
- Older than 30 days
- Larger than 50 GB
- More than 25 million documents
Conditions allow lifecycle decisions to adapt dynamically as data grows.
Transitions
Transitions move an index from one state to another once defined conditions are met.
For example:
Hot
↓ after 30 days
Warm
↓ after 90 days
Cold
↓ after 365 days
DeleteBecause transitions occur automatically, administrators rarely need to intervene after the policy is deployed.
Policies
A policy combines states, actions, and transitions into a complete lifecycle definition.
For example, a Wazuh alerts policy might specify:
- Hot for 30 days
- Warm for 90 days
- Cold until one year
- Delete after 365 days
Policies can be attached to:
- Individual indexes
- Index patterns
- Index templates
Organizations often create separate policies for alerts, archives, and monitoring indexes to reflect different retention requirements.
Index Templates
Index templates automatically apply ISM policies to newly created indexes.
Without templates, administrators would need to attach lifecycle policies manually every time a new index is created.
Templates ensure consistency by automatically assigning:
- Mappings
- Settings
- Shard configuration
- Replica configuration
- ISM policy
- Rollover alias
This automation becomes especially valuable in environments where new indexes are created frequently.
Rollovers
Rollovers create a new write index when predefined thresholds are reached.
Common rollover triggers include:
- Maximum size
- Maximum age
- Maximum document count
Instead of allowing one index to grow indefinitely, OpenSearch creates a fresh index while applications continue writing through an alias.
Benefits include:
- More consistent shard sizes
- Faster searches
- Better resource utilization
- Reduced cluster imbalance
The OpenSearch project recommends rollover-based index management for time-series workloads because it produces more predictable index sizes and improves lifecycle automation.
Deletion
The final stage of most lifecycle policies is automatic deletion.
Once an index exceeds the configured retention period, ISM permanently removes it without administrator intervention.
Automatic deletion helps:
- Reclaim disk space
- Prevent storage exhaustion
- Maintain healthy clusters
- Enforce retention policies consistently
Before enabling automatic deletion, organizations should verify that important indexes have been backed up using snapshots.
Readers responsible for long-term data retention should also review How to Configure Wazuh Log Retention.
Prerequisites
Before implementing Index State Management, verify that your Wazuh environment is properly prepared.
While configuring ISM is straightforward, applying lifecycle policies without proper planning can result in unintended data loss or operational issues.
Supported Wazuh and OpenSearch Versions
Ensure your Wazuh deployment includes a version of the Wazuh Indexer that supports OpenSearch Index State Management.
Older Elasticsearch-based Wazuh releases used Index Lifecycle Management (ILM), while current OpenSearch-based releases use ISM.
Always confirm compatibility with the version of Wazuh and OpenSearch you are running before creating policies.
The official Wazuh documentation includes version compatibility details for supported releases.
Administrative Access to Wazuh Dashboard or OpenSearch API
Creating and managing ISM policies requires administrative privileges.
You should have access to either:
- The Wazuh Dashboard’s Index Management interface
- The OpenSearch REST API
- Command-line tools capable of sending authenticated API requests
Most lifecycle management tasks, including creating policies, attaching templates, and monitoring execution, can be completed through either interface.
Existing Wazuh Indexer Cluster
ISM policies are applied to indexes stored in the Wazuh Indexer.
Before proceeding, verify that:
- The Indexer cluster is healthy
- All nodes are online
- Cluster status is Green (or Yellow if appropriate)
- Index creation is functioning normally
If your cluster already reports health issues, resolve them before deploying lifecycle policies.
See How to Fix a Yellow Cluster Status in Wazuh Indexer and The Complete Wazuh Cluster Architecture Guide..
Snapshot Strategy Before Deleting Indexes
Automatic deletion should never be enabled without first establishing a backup strategy.
Before indexes reach the Delete state, consider:
- Creating scheduled snapshots
- Testing snapshot restoration
- Defining recovery procedures
- Verifying backup retention periods
The OpenSearch documentation recommends snapshots as the primary disaster recovery mechanism before permanently deleting index data.
Understanding of Index Patterns
Finally, administrators should understand how index patterns map to different categories of Wazuh data.
Before applying policies, identify:
- Alert indexes
- Archive indexes
- Monitoring indexes
- Internal system indexes
- Custom application indexes
Applying the wrong policy to an index pattern can lead to premature deletion of critical data or retention of unnecessary information.
Taking time to inventory your index patterns ensures that each dataset receives a lifecycle policy aligned with its operational and compliance requirements.
How to Configure Wazuh Index State Management
Once you’ve planned your index lifecycle strategy, the next step is implementing it in your Wazuh environment.
The overall process involves analyzing your existing indexes, defining lifecycle policies, applying them to index templates, and monitoring their execution over time.
Although the exact interface may vary slightly depending on your Wazuh and OpenSearch versions, the workflow remains largely the same.
Step 1: Review Existing Indexes
Before creating any ISM policies, understand the indexes currently stored in your Wazuh Indexer.
Applying lifecycle policies without first reviewing your existing indexes can lead to unexpected rollovers or accidental deletion of important data.
Inspect Current Wazuh Indexes
Start by listing all indexes in your cluster.
If you’re using the OpenSearch API:
GET _cat/indices?vOr with curl:
curl -k -u admin:password https://INDEXER:9200/_cat/indices?vThe output displays information such as:
- Index name
- Health status
- Primary shards
- Replica shards
- Document count
- Storage size
Review this information to understand how your data is currently distributed.
Verify Index Naming Patterns
Look for consistent naming conventions such as:
wazuh-alerts-*
wazuh-archives-*
wazuh-monitoring-*If custom indexes exist, document them before applying lifecycle policies.
Consistent naming patterns make it much easier to target indexes using templates and wildcard patterns.
Check Index Sizes and Ages
Pay particular attention to:
- Very large indexes
- Extremely old indexes
- Uneven index sizes
- Unexpected growth
Useful commands include:
GET _cat/indices?v&s=store.sizeand
GET _cat/indices?v&s=creation.dateUnderstanding current growth trends helps determine appropriate rollover thresholds.
Step 2: Plan Your Retention Strategy
Every organization has different retention requirements.
Rather than copying another organization’s policy, design one that balances storage costs, search performance, and compliance obligations.
Define Retention Requirements
Ask questions such as:
- How long should alerts remain searchable?
- How long must raw logs be retained?
- Are compliance regulations involved?
- Is historical threat hunting required?
For example:
| Data Type | Suggested Retention |
|---|---|
| Security alerts | 180 days |
| Raw archives | 90 days |
| Monitoring data | 30 days |
| Internal metrics | 14–30 days |
These values should reflect your operational and regulatory needs.
Separate Hot Data From Older Data
Not all indexed data requires high-performance storage.
Recent security events are typically queried frequently, while older events are accessed only during investigations or audits.
A common lifecycle looks like:
- Hot: 0–30 days
- Warm: 30–90 days
- Cold: 90–365 days
- Delete: After retention expires
Separating active and historical data helps improve cluster efficiency.
Determine Rollover Conditions
Choose thresholds that create consistently sized indexes.
Common rollover triggers include:
- 30–50 GB index size
- 25–50 million documents
- 7–30 days of age
Avoid creating indexes that are either extremely small or excessively large.
For additional guidance, see How to Design a Wazuh OpenSearch Shard Allocation Strategy.
Step 3: Create an ISM Policy
Once your retention strategy is finalized, create the lifecycle policy that OpenSearch will enforce.
Policies are typically created using either:
- Wazuh Dashboard
- OpenSearch Dashboards
- OpenSearch REST API
Define Policy Name
Use descriptive names that identify the purpose of each policy.
Examples:
alerts-retentionarchives-policymonitoring-retentionsecurity-alerts-365d
Clear naming conventions simplify long-term administration.
Configure States
A typical security alerts policy may contain:
- Hot
- Warm
- Cold
- Delete
Each state contains its own actions and transition rules.
Add Rollover Actions
Configure rollover based on:
- Maximum size
- Maximum age
- Maximum document count
Example:
"rollover": {
"min_size": "50gb",
"min_index_age": "30d"
}The exact thresholds should match your indexing rate and hardware capacity.
Configure Deletion Rules
The final state usually removes expired indexes automatically.
Example:
"delete": {}Before enabling deletion, ensure that snapshots are created and tested.
Readers responsible for backup planning should also review How to Backup Wazuh Manager Configuration.
Step 4: Create an Index Template
Index templates ensure that every newly created index automatically inherits the appropriate lifecycle policy.
Without templates, administrators would need to attach policies manually after each rollover.
Associate the Policy With New Indexes
Within the template, specify the ISM policy ID.
For example:
"plugins.index_state_management.policy_id": "alerts-retention"Every new matching index automatically receives the policy.
Configure Index Patterns
Define which indexes the template should manage.
Examples include:
wazuh-alerts-*
wazuh-archives-*Use patterns that are specific enough to avoid affecting unrelated indexes.
Apply Rollover Aliases
Configure a write alias for rollover operations.
Example:
Alias:
wazuh-alertsWhen a rollover occurs, OpenSearch automatically updates the alias to point to the newest write index.
The OpenSearch documentation recommends using rollover aliases together with index templates for automated lifecycle management.
Step 5: Apply the Policy to Existing Indexes
Templates only affect future indexes.
Existing indexes must be managed separately.
Attach Policies Manually
You can attach a policy through:
- Wazuh Dashboard
- OpenSearch Dashboards
- REST API
Example:
POST _plugins/_ism/add/wazuh-alerts-000001This associates the selected index with the specified lifecycle policy.
Verify Successful Assignment
Confirm the policy has been attached successfully.
Useful API:
GET _plugins/_ism/explain/wazuh-alerts-000001Review:
- Current state
- Managed status
- Policy ID
- Transition history
Step 6: Test Policy Execution
Never deploy lifecycle policies to production without testing.
A controlled test verifies that indexes transition exactly as expected.
Simulate Lifecycle Events
Use a test policy with shorter thresholds.
Example:
- Rollover after one hour
- Warm after two hours
- Delete after one day
Testing shorter intervals allows administrators to validate policy behavior quickly.
Validate State Transitions
Verify that indexes move through each configured state.
Typical sequence:
Hot
↓
Warm
↓
Cold
↓
DeleteReview policy status after every transition.
Confirm Rollover Behavior
Ensure that:
- A new write index is created
- The alias moves correctly
- Data continues indexing without interruption
- Searches include both old and new indexes
Failure during rollover usually indicates alias or template configuration issues.
Step 7: Monitor Policy Status
After deployment, continue monitoring lifecycle execution.
Regular reviews help identify configuration problems before they impact production.
View Policy Execution History
OpenSearch records lifecycle activity for managed indexes.
Review:
- Completed actions
- Failed actions
- Retry attempts
- Transition timestamps
Execution history is invaluable when troubleshooting lifecycle issues.
Check Managed Indexes
Periodically verify:
- Which indexes are managed
- Current lifecycle state
- Policy version
- Next scheduled action
The Explain API is particularly useful for ongoing monitoring.
Troubleshoot Failed Transitions
Common causes of policy failures include:
- Missing rollover aliases
- Incorrect index patterns
- Read-only indexes
- Cluster health problems
- Insufficient disk space
- Invalid policy definitions
If lifecycle operations begin failing, first verify overall cluster health.
Readers experiencing storage-related issues should see How to Fix a Yellow Cluster Status in Wazuh Indexer and The Complete Wazuh Cluster Architecture Guide.
For additional implementation details, consult the official OpenSearch ISM documentation.
Example Wazuh ISM Policy
The following examples illustrate a practical Index State Management configuration for Wazuh security alerts.
They are intended as a starting point and should be adjusted to match your organization’s storage capacity, compliance requirements, and indexing volume.
Example Policy for Security Alerts
The following lifecycle keeps frequently accessed data on high-performance storage while automatically removing expired indexes after one year.
| State | Actions | Transition |
|---|---|---|
| Hot | Accept writes, rollover | After 30 days or 50 GB |
| Warm | Read-only, force merge | After 90 days |
| Cold | Reduce replicas, archive storage | After 180 days |
| Delete | Remove index | After 365 days |
This policy balances performance with long-term storage efficiency.
Example Rollover Configuration
Example rollover settings:
{
"rollover": {
"min_size": "50gb",
"min_index_age": "30d"
}
}Many organizations choose rollover based primarily on index size because it results in more consistent shard distribution.
Example Delete Policy
The Delete state can be configured as follows:
{
"delete": {}
}Once the retention period expires, OpenSearch permanently removes the index.
Only enable automatic deletion after confirming that your snapshot process is functioning correctly.
Example Index Template
A simplified template might include:
{
"index_patterns": [
"wazuh-alerts-*"
],
"settings": {
"plugins.index_state_management.policy_id": "alerts-retention",
"plugins.index_state_management.rollover_alias": "wazuh-alerts"
}
}This ensures that every new alerts index automatically receives the lifecycle policy and rollover alias.
Example API Requests
Create an ISM policy:
PUT _plugins/_ism/policies/alerts-retentionAttach the policy:
POST _plugins/_ism/add/wazuh-alerts-000001Verify policy status:
GET _plugins/_ism/explain/wazuh-alerts-000001Retrieve policy details:
GET _plugins/_ism/policies/alerts-retentionThe OpenSearch ISM API reference contains complete request and response examples for all supported lifecycle operations.
Choosing the Right Retention Policy
There is no universal retention period that fits every Wazuh deployment.
The appropriate policy depends on factors such as data volume, available storage, regulatory obligations, and incident response requirements.
The following recommendations provide a practical starting point.
| Environment | Suggested Retention |
|---|---|
| Home Lab | 7–30 days |
| Small Business | 30–90 days |
| Medium Enterprise | 90–180 days |
| Large Enterprise | 180–365 days |
| Compliance-Regulated Organizations | 1–7 years (often combined with snapshots or archive storage) |
Organizations subject to regulations such as PCI DSS, HIPAA, SOX, or ISO 27001 should verify their retention periods against applicable legal and contractual requirements before implementing automatic deletion.
For many regulated environments, a hybrid approach, keeping recent data in the Wazuh Indexer while preserving older data in snapshots or archival storage, offers the best balance between search performance, storage costs, and compliance.
The NIST Guide to Computer Security Log Management (SP 800-92) recommends establishing documented log retention policies that align with organizational and regulatory requirements.
Performance Best Practices
A well-designed Index State Management (ISM) policy does more than automate index retention.
It also helps maintain a fast, stable, and scalable Wazuh deployment.
Following the best practices below will help maximize cluster performance while reducing operational issues.
Use Rollover Instead of Fixed Daily Indexes
Many older Wazuh deployments create a new index every day regardless of how much data is written.
For example:
wazuh-alerts-2026.07.24
wazuh-alerts-2026.07.25
wazuh-alerts-2026.07.26While simple, this approach often results in:
- Uneven shard sizes
- Large numbers of underutilized indexes
- Increased cluster overhead
Instead, configure rollovers based on:
- Maximum index size
- Maximum document count
- Maximum index age
Rollover policies create indexes only when needed, resulting in more consistent shard utilization and improved cluster efficiency.
OpenSearch recommends rollover-based lifecycle management for time-series workloads because it produces more predictable index sizes and improves resource utilization.
Keep Shard Sizes Consistent
Very small shards waste system resources, while extremely large shards increase recovery times and query latency.
Aim for consistent shard sizes across your indexes.
Benefits include:
- Faster searches
- Balanced node utilization
- Quicker shard recovery
- Reduced cluster overhead
If shard sizes vary significantly, review your rollover thresholds and indexing patterns.
For additional planning guidance, see How to Design a Wazuh OpenSearch Shard Allocation Strategy.
Avoid Excessive Numbers of Small Indexes
Creating too many small indexes can negatively affect cluster performance.
Every index consumes memory and cluster metadata regardless of how much data it stores.
Symptoms include:
- Slow cluster state updates
- Increased JVM memory usage
- Longer startup times
- Slower dashboard performance
Rather than creating hundreds of tiny indexes, use rollover policies that maintain healthy index sizes.
Configure Disk Watermarks
OpenSearch uses disk watermarks to prevent nodes from becoming completely full.
Typical watermark thresholds include:
- Low watermark – Prevents new shard allocations when disk usage becomes elevated.
- High watermark – Relocates shards away from heavily utilized nodes.
- Flood-stage watermark – Marks affected indexes as read-only to prevent data corruption.
Properly configured watermarks provide an additional layer of protection alongside ISM policies.
If disk utilization has already become problematic, review How to Fix a Yellow Cluster Status in Wazuh Indexer.
The official OpenSearch documentation explains how disk-based shard allocation and watermarks help maintain cluster stability.
Monitor Cluster Health Regularly
Even well-designed lifecycle policies should be monitored continuously.
Regularly review:
- Cluster health
- Disk utilization
- JVM heap usage
- Index growth
- Shard allocation
- Failed lifecycle actions
Monitoring helps identify potential problems before they affect production workloads.
Organizations managing larger deployments should also review Step-by-Step Wazuh Manager Scaling Guide.
Use Snapshots Before Deletion
Automatic deletion permanently removes index data.
Before deleting any production indexes:
- Create scheduled snapshots
- Verify snapshot completion
- Test restoration procedures
- Document recovery processes
Snapshots provide a safety net in case retention policies remove data unexpectedly.
OpenSearch recommends snapshots as the primary backup mechanism for indexes.
Test Policies in a Non-Production Environment
Never deploy a new ISM policy directly to production.
Instead:
- Create a staging environment
- Use shortened retention periods
- Verify rollover behavior
- Validate state transitions
- Confirm deletion timing
Testing allows administrators to identify configuration issues before production data is affected.
Review Policy Execution Logs
Lifecycle execution logs provide valuable insight into how policies are operating.
Regularly review:
- Successful actions
- Failed actions
- Retry attempts
- Transition history
- Execution timestamps
These logs often reveal configuration mistakes before they become serious operational issues.
Document Index Lifecycle Policies
As environments grow, multiple lifecycle policies may exist for different datasets.
Document each policy, including:
- Managed index patterns
- Rollover thresholds
- Retention periods
- Snapshot requirements
- Responsible administrators
- Policy revision history
Good documentation simplifies troubleshooting and future maintenance.
Align Retention with Compliance Requirements
Retention periods should reflect both operational needs and applicable regulations.
Consider factors such as:
- Legal requirements
- Industry standards
- Internal security policies
- Storage costs
- Incident response needs
Avoid retaining logs longer than necessary, but ensure they remain available for audits and investigations.
The NIST Guide to Computer Security Log Management emphasizes that organizations should establish documented log retention policies aligned with business and regulatory requirements.
Common Wazuh ISM Problems
Even though ISM automates index lifecycle management, configuration mistakes can prevent policies from executing correctly.
Understanding the most common issues makes troubleshooting significantly easier.
Policy Not Applying to New Indexes
One of the most common problems is that newly created indexes never become managed.
Possible causes include:
- Incorrect index pattern
- Missing policy ID
- Template not applied
- Higher-priority template overriding settings
Verify that:
- The template matches the index name.
- The policy ID is correct.
- The template has been successfully installed.
Index Never Rolls Over
Indexes sometimes continue growing long after rollover thresholds should have been reached.
Common causes include:
- Missing rollover alias
- Thresholds not yet satisfied
- Incorrect write index
- Invalid policy configuration
Use the Explain API to verify the current lifecycle state and pending actions.
Rollover Alias Configuration Errors
A rollover alias must always point to the current write index.
Misconfigured aliases often produce errors such as:
- Failed rollover
- Duplicate write index
- Index remains unmanaged
Verify:
- Alias name
- Write index designation
- Template configuration
Most rollover problems originate from alias configuration rather than the policy itself.
Policy Stuck in Initial State
If an index remains indefinitely in the Hot state, check:
- Transition conditions
- Index age
- Index size
- Policy syntax
- Execution history
Remember that lifecycle transitions only occur after the configured conditions are satisfied.
Index Deletion Never Occurs
Expired indexes may remain even after the retention period.
Possible reasons include:
- Delete state not configured
- Transition never reached
- Policy execution failures
- Index not managed
- Snapshot workflow preventing deletion
Confirm that the Delete state exists and that the index successfully completed all previous lifecycle stages.
Policy Execution Failures
Execution failures usually indicate configuration or cluster problems.
Typical causes include:
- Cluster health issues
- Read-only indexes
- Missing permissions
- Invalid actions
- API errors
Review execution logs to determine the exact failure reason.
Disk Usage Continues Growing
If storage continues increasing despite ISM policies, investigate:
- Snapshot retention
- Old unmanaged indexes
- Failed deletion actions
- Archive indexes
- Replica configuration
Storage growth often results from indexes that were created before lifecycle policies were introduced.
Readers experiencing persistent storage issues should review How to Configure Wazuh Log Retention.
Managed Index Shows Errors
An index may appear as managed while still reporting lifecycle errors.
The Explain API can reveal:
- Current state
- Failed action
- Retry status
- Error messages
- Last successful transition
This information greatly simplifies troubleshooting.
Conflicts Between Templates
Multiple index templates matching the same index can override one another.
Common symptoms include:
- Missing policy assignment
- Incorrect shard configuration
- Unexpected replica counts
- Missing rollover alias
Review template priorities and ensure only the intended template manages each index pattern.
Snapshot Failures Before Deletion
Some organizations require snapshots before deleting indexes.
Failures typically occur because of:
- Unavailable repository
- Authentication problems
- Storage capacity limits
- Repository configuration errors
Regularly test snapshot creation and restoration to ensure backups are available when needed.
For organizations relying on snapshots, the OpenSearch Snapshot documentation provides configuration and troubleshooting guidance.
Security Best Practices
Index State Management automates the handling of valuable security data, making it important to secure both the lifecycle policies and the infrastructure that manages them.
Restrict Administrative Access
Only trusted administrators should be able to:
- Create policies
- Modify templates
- Delete indexes
- Configure rollover aliases
- Manage snapshots
Limiting administrative access reduces the risk of accidental or malicious configuration changes.
Protect Snapshot Repositories
Snapshots often contain complete copies of your security logs.
Protect snapshot repositories by:
- Restricting access permissions
- Encrypting storage when supported
- Using dedicated backup credentials
- Monitoring repository activity
Compromised snapshots can expose sensitive operational and security data.
Validate Policies Before Deployment
Before applying a policy to production:
- Review lifecycle states
- Verify transitions
- Test rollover conditions
- Confirm retention periods
- Validate deletion timing
Peer review or change approval processes can help catch configuration mistakes before deployment.
Use Role-Based Access Control
Implement Role-Based Access Control (RBAC) so users receive only the permissions required for their responsibilities.
For example:
- Security analysts can search indexes.
- Platform administrators can manage lifecycle policies.
- Backup administrators can manage snapshots.
Following the principle of least privilege reduces the attack surface.
If you’re configuring permissions within Wazuh, see Troubleshooting Wazuh RBAC.
Audit Policy Changes
Track all lifecycle-related modifications, including:
- Policy updates
- Template changes
- Alias modifications
- Retention adjustments
- Administrative actions
Audit logs simplify compliance reporting and incident investigations.
Encrypt Communications Between Cluster Nodes
Protect communications between:
- Wazuh Managers
- Wazuh Indexer nodes
- Dashboards
- API clients
Encryption helps prevent interception or manipulation of sensitive security data while it is in transit.
The OpenSearch Security documentation recommends using TLS to secure both inter-node communication and client connections.
Regularly Review Retention Policies
Business requirements, storage capacity, and regulatory obligations change over time.
Review lifecycle policies periodically to ensure they continue to:
- Meet compliance requirements
- Support investigation needs
- Optimize storage utilization
- Reflect current business objectives
Annual or semi-annual reviews are a good practice for most organizations.
Maintain Backup Copies Before Deleting Data
Before allowing ISM to permanently remove indexes:
- Verify recent snapshots exist.
- Confirm backups are recoverable.
- Test restoration procedures.
- Document recovery workflows.
Maintaining reliable backups helps ensure that critical security data can be restored if it is deleted prematurely or required for future investigations.
This practice is particularly important for organizations subject to legal hold requirements, forensic investigations, or long-term regulatory retention obligations.
Real-World Example
Scenario
A security operations team manages a Wazuh deployment monitoring approximately 15,000 endpoints across multiple business units.
The environment collects security telemetry from Windows servers, Linux systems, cloud workloads, network devices, and business applications.
As the deployment grows, the Wazuh Indexer begins storing hundreds of gigabytes of security events every week. The team notices several operational challenges:
- Disk utilization continuously increases
- Search performance becomes slower during investigations
- Older indexes consume valuable storage space
- Administrators spend several hours each month manually reviewing and deleting outdated indexes
The organization initially relied on manual cleanup procedures, but this approach became difficult to maintain as log volume increased.
How to Solve the Problem
To solve the problem, the administrators implement Wazuh Index State Management (ISM) policies.
The new lifecycle strategy includes:
- Rolling over security alert indexes when they reach a predefined size threshold
- Keeping frequently accessed security data available for 90 days
- Creating snapshots before removing older indexes
- Automatically deleting expired indexes after the retention period
- Applying lifecycle policies automatically through index templates
The team creates separate retention policies for different types of Wazuh data:
| Index Type | Lifecycle Strategy |
|---|---|
| Security alerts | High-performance storage for 90 days, then deletion |
| Archive logs | Shorter retention with snapshots for long-term storage |
| Monitoring indexes | Reduced retention for operational metrics |
After deployment, the environment becomes significantly easier to manage.
Results:
The results include:
- Predictable storage growth
- Faster dashboard queries
- Reduced index management overhead
- Improved cluster stability
- Consistent enforcement of retention requirements
The security team no longer needs to manually identify and remove old indexes.
Instead, ISM automatically manages the entire lifecycle based on predefined policies.
This approach allows the organization to maintain an effective balance between:
- Security visibility — keeping recent events quickly searchable
- Infrastructure efficiency — preventing unnecessary storage growth
- Compliance requirements — preserving logs according to retention obligations
For larger environments, combining ISM with proper cluster architecture and shard planning is critical.
Organizations should also review The Complete Wazuh Cluster Architecture Guide and How to Build a Wazuh Indexer Cluster when designing scalable deployments.
Frequently Asked Questions (FAQ)
Question: What is Wazuh Index State Management (ISM)?
Wazuh Index State Management (ISM) is an OpenSearch feature used by the Wazuh Indexer to automatically manage the lifecycle of indexes.
ISM policies define how indexes should behave over time, including:
- When indexes should roll over
- When data should move between lifecycle states
- When indexes should be optimized
- When old data should be deleted
Instead of manually maintaining indexes, administrators define policies that OpenSearch executes automatically.
Question: Does Wazuh Include Index State Management by Default?
Yes, Wazuh deployments using the Wazuh Indexer include access to OpenSearch Index State Management capabilities.
However, organizations may need to configure custom policies depending on their:
- Data volume
- Retention requirements
- Compliance obligations
- Storage architecture
Default configurations may not be sufficient for larger enterprise deployments generating high volumes of security events.
Question: What Is the Difference Between ISM and Index Lifecycle Management (ILM)?
ISM and Index Lifecycle Management (ILM) solve the same general problem which is automating index lifecycle operations.
However, they belong to different search platforms.
| Feature | ISM | ILM |
|---|---|---|
| Platform | OpenSearch | Elasticsearch |
| Used By | Wazuh Indexer | Elasticsearch clusters |
| Lifecycle States | Yes | Yes |
| Rollover Support | Yes | Yes |
| Automated Deletion | Yes | Yes |
Wazuh uses OpenSearch-based indexing, so modern Wazuh deployments use ISM rather than Elasticsearch ILM.
Question: When Should a Wazuh Index Roll Over?
A Wazuh index should roll over when it reaches a size or age threshold that maintains healthy shard sizes.
Common rollover triggers include:
- 30–50 GB index size
- 7–30 days of index age
- Millions of indexed documents
The correct rollover value depends on:
- Event ingestion rate
- Hardware resources
- Number of shards
- Search requirements
Large environments should test rollover thresholds rather than relying on generic recommendations.
Question: How Long Should Wazuh Security Logs Be Retained?
Retention depends on your organization’s requirements.
Typical examples include:
- Home lab: 7–30 days
- Small business: 30–90 days
- Enterprise: 90–365 days
- Regulated environments: 1–7 years
Factors that influence retention include:
- Compliance requirements
- Investigation needs
- Storage costs
- Threat hunting requirements
Security alerts are often retained longer than raw archive logs because they contain higher-value security information.
Question: Can ISM Automatically Delete Old Wazuh Indexes?
Yes.
ISM can automatically delete indexes after they reach a defined retention period.
A typical lifecycle might look like:
Hot
↓
Warm
↓
DeleteBefore enabling automatic deletion, organizations should verify that:
- Snapshots are working correctly
- Retention requirements are satisfied
- Deleted data can be recovered if necessary
Question: Can I Apply an ISM Policy to Existing Indexes?
Yes.
Existing indexes can have ISM policies applied manually through:
- OpenSearch API requests
- Wazuh Dashboard interfaces
- OpenSearch management tools
However, index templates only affect newly created indexes.
Existing indexes must be managed separately after policy creation.
Question: How Do I Verify That an ISM Policy Is Working?
The easiest method is using the ISM Explain API.
Example:
GET _plugins/_ism/explain/wazuh-alerts-000001The response shows:
- Current lifecycle state
- Assigned policy
- Pending actions
- Transition history
- Errors
Administrators should regularly review managed indexes to confirm lifecycle automation is operating correctly.
Question: Can I Use Snapshots Before Deleting Indexes?
Yes.
Snapshots are commonly used alongside ISM policies to preserve historical data before deletion.
A typical workflow is:
- Index reaches retention threshold
- Snapshot is created
- Data is archived
- Index is deleted automatically
This approach allows organizations to maintain long-term retention without keeping every index active inside the Wazuh Indexer.
Question: Does Index State Management Improve Wazuh Performance?
Yes, when configured correctly.
ISM improves performance by:
- Preventing uncontrolled index growth
- Maintaining predictable shard sizes
- Removing unnecessary historical data
- Reducing cluster metadata overhead
- Optimizing storage usage
However, ISM is only one component of Wazuh performance optimization.
Performance also depends on:
- Hardware resources
- Shard allocation strategy
- JVM heap configuration
- Index mappings
- Cluster architecture
For additional optimization guidance, see How to Tune OpenSearch Heap Size to Stop Wazuh High Memory Crashes and How to Design a Wazuh OpenSearch Shard Allocation Strategy.
Conclusion
As Wazuh environments grow, manually managing indexes becomes increasingly difficult.
Large deployments generate massive amounts of security telemetry, making automated lifecycle management essential for maintaining performance, reliability, and predictable storage usage.
Wazuh Index State Management (ISM) provides a structured approach for controlling how security event indexes are created, maintained, optimized, and removed.
By implementing ISM policies, organizations can:
- Automatically roll over large indexes
- Reduce unnecessary storage consumption
- Improve search performance
- Prevent disk exhaustion
- Simplify retention management
- Maintain consistent lifecycle processes
The configuration process involves:
- Reviewing existing Wazuh indexes
- Designing a retention strategy
- Creating ISM policies
- Applying policies through index templates
- Managing existing indexes
- Testing lifecycle transitions
- Monitoring policy execution
However, ISM should not be treated as a one-time configuration task.
Organizations should regularly review:
- Index growth patterns
- Retention requirements
- Compliance obligations
- Storage capacity
- Lifecycle policy effectiveness
As security environments evolve, lifecycle policies should evolve with them.
The most effective Wazuh deployments balance three critical objectives:
- Retention — preserving the security data needed for investigations and compliance
- Performance — maintaining fast searches and responsive dashboards
- Efficiency — controlling infrastructure costs and operational complexity
By combining Index State Management with proper shard planning, cluster architecture, backups, and ongoing monitoring, organizations can build a scalable Wazuh platform capable of handling long-term security data growth.

Be First to Comment