Hello! Thank you for reaching out to us!
For example, to get the alerts from the index wazuh-alerts-4.x-*, this should be the URL to query:
https://{ip_address}:9200/wazuh-alerts-4.x-*/_search?
This is an example body, where you will indicate the search filters:
{
"query": {
"bool": {
"must": [ {
}
},
"size": 10,
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}
As an alternative, using the Wazuh archives without using the API may also work for your case. Your wazuh manager stores all alerts and events in /var/ossec/logs/archives and /var/ossec/logs/alerts both as a logfile and in json format. Older files are moved to subdirectories referenced by the creation date.