Alerts
Generate SQL from alert query parameters
Generates a SQL query string based on alert query parameters including stream, aggregations, and conditions. This endpoint is useful for testing alert queries and understanding the SQL that will be executed.
post/api/v2/{org_id}/alerts/generate_sql
Request
- Base URLhttps://api.openobserve.ai (the document declares no server; this is the origin it was published from)
- AuthAPI key in header Authorization
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
org_idstring required
Organization name
Request body
Example request
{
"stream_name": "default"
}Response
Success
Example response
{
"sql": "SELECT * FROM \"my_stream\" WHERE field > 100"
}Changes
No recorded changes to this operation across all 1 revision of this API.