Spaces method and path for this operation:
post /s/{space_id}/api/streams/{name}/significant_events/_preview
Refer to Spaces for more information.
Preview significant event results based on a given query
[Required authorization] Route required privileges: read_stream.
Query parameters
-
Start of the time range as an ISO 8601 date string.
-
End of the time range as an ISO 8601 date string.
-
The bucket size for aggregating events (e.g. "1m", "1h").
Format should match the following pattern:
^(\d+)([smhd])$.
POST
/api/streams/{name}/significant_events/_preview
curl \
--request POST 'https://localhost:5601/api/streams/{name}/significant_events/_preview?from=string&to=string&bucketSize=string' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"query":{"esql":{"query":"FROM logs.nginx | WHERE log.level == \"error\" | STATS count = COUNT(*) BY host.name"}}}'
Request example
{
"query": {
"esql": {
"query": "FROM logs.nginx | WHERE log.level == \"error\" | STATS count = COUNT(*) BY host.name"
}
}
}