Hi le Sok.
Your command is working fine. You are not getting any results because you dont have unassigned shards, to check you need to first run the Indexer Cluster Health command. This will provide useful information like Cluster Name, Cluster Status, Number of Nodes, Active Primary Shards, Active Shards, Relocating Shards, Active Shards, and Unassigned Shards (e.g., 219).
output will be the same as:
{"cluster_name":"wazuh-cluster","status":"green","timed_out":false,"number_of_nodes":1,"number_of_data_nodes":1,"discovered_master":true,"discovered_cluster_manager":true,"active_primary_shards":68,"active_shards":68,"relocating_shards":0,"initializing_shards":0,"
unassigned_shards":0,"delayed_unassigned_shards":0,"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0,"active_shards_percent_as_number":100.0}
The bold part is the no. of unassigned shards if this is 0 the second will not give any output as the second command is for find the name and current state of unassigned shard.
You can find the Indexer IP in the Filebeat config file, For example:
output.elasticsearch.hosts:
- 127.0.0.1:9200
All to free up the same space you can also manually delete the old index:
It is necessary to delete old indices if they are of no use. It is necessary to check what the indices stored in the environment, the following API call can help:
GET _cat/indicesThen, it is necessary to delete indices that are not needed or older indices. Bear in mind that this cannot be retrieved unless there are backups of the data either using snapshots or Wazuh alerts backups.
The API call to delete indices is:
DELETE <index_name>Or CLI command
# curl -k -u admin:admin -XDELETE https://<WAZUH_INDEXER_IP>:9200/wazuh-alerts-4.x-YYYY.MM.DDYou can use wildcards (*) to delete more indices in one query.
Hope this helps