Hello Matteo
You can use Dev Tools: click on the left menu, then click Dev Tools, under Management. Example:
POST _plugins/_sql
{
"query": "SELECT * FROM wazuh-alerts-4.x-2022.06.28 LIMIT 50"
}
Based on opensearch SQL plugin documentation: https://opensearch.org/docs/latest/search-plugins/sql/index/#rest-api, you can use the format modifier to get the results in CSV format:
POST _plugins/_sql?format=csv
{
"query": "SELECT * FROM wazuh-alerts-4.x-2022.06.28 LIMIT 50"
}
This kind of query can’t be scheduled using the web user interface yet. But you can configure a Cron Job that uses this query with curl for instance and save the results into a file or whatever.
Don’t hesitate to let me know if you have any questions about how to achieve this.
Regards
--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/926c1204-30e6-4a2a-9fc3-f84962a2791en%40googlegroups.com.
Sure,
curl -XPOST "https://10.0.2.34:9200/_plugins/_sql?format=csv" -k -u admin:password -H 'Content-Type: application/json' -d'
{
"query": "SELECT * FROM wazuh-alerts-4.x-2022.06.28 LIMIT 50"
}
'
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/ebda6609-07a6-4771-b649-89d4673f4705n%40googlegroups.com.