Hi Francesc,
The default shard limit is 1000, and increasing it is not recommended because each shard consumes significant resources (CPU, memory, and disk I/O), even if it holds minimal data. Too many small shards can lead to slower query performance, higher overhead, cluster instability, and resource exhaustion. Additionally, the current increased shard count is already nearing capacity. Instead of increasing the shard limit, we recommend the following solutions:
Solution 1: Manually Delete Indices
You should review the stored indices using the following API call:
GET _cat/indicesFrom there, you can delete unnecessary or old indices. Note that deleted indices cannot be retrieved unless backed up through snapshots or Wazuh alert backups. The API call to delete indices is:
DELETE <index_name>Or via the CLI:
curl -k -u admin:admin -XDELETE https://<WAZUH_INDEXER_IP>:9200/wazuh-alerts-4.x-YYYY.MM.DDYou can also use wildcards (*) to delete multiple indices in one go.
Solution 2: Index Management Policies
You can automate index deletion by setting up Index Lifecycle Management (ILM) policies, as explained in this post:(
https://wazuh.com/blog/wazuh-index-management). Additionally, you can set up snapshots to automatically back up Wazuh indices to local or cloud storage for restoration when needed. More details on this can be found in the (
https://wazuh.com/blog/index-backup-management) article.
Solution 3: Add an Indexer Node
Adding another indexer node will increase the capacity and resilience of your Wazuh monitoring infrastructure. For more information on how to do this, refer to the official guide: (
https://documentation.wazuh.com/current/user-manual/upscaling/adding-indexer-node.html).
ISM Policies Not WorkingIf your ISM policies are failing, it's likely due to resource constraints. At least 20% free disk space is required to apply ISM policies. The recent surge in events may be contributing to this. If your storage usage is excessive, we recommend reviewing agent logs or syslogs to identify the types of events contributing to the high log volume. This analysis will help you fine-tune log generation.
Unassigned Shards (.opendistro Pattern)This pattern relates to system indices, which are protected. To address this issue, you can remove the replica by setting the number of replicas to 0.
Solution 1: Change System Index Settings- Modify the `/etc/wazuh-indexer/opensearch.yml` file by changing `plugins.security.system_indices.enabled: true` to `false`.
- Restart the indexer:
systemctl restart wazuh-indexer- From the Wazuh UI, go to Index Management> Indexes, select the unassigned indices, and change the number of replicas to 0.
Solution 2: Use the CLICreate index templates for all OpenSearch system indices and set the number of replicas to 0:
curl --key admin-key.pem --cert admin.pem --insecure -XPUT https://127.0.0.1:9200/_index_template/ism_history_indices -H 'Content-Type: application/json' -d'
{
"index_patterns": [
".opendistro-ism-managed-index-history-*"
],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
}'You can also follow this (
https://groups.google.com/g/wazuh/c/tgaabFMiAL8) for further guidance. Afterward, make sure to revert `
plugins.security.system_indices.enabled` to `true`.Hope this helps