Ad-hoc analytics queries tools
- execute_analytics_eql: Run a one-off analytics query written in EQL.
execute_analytics_eql
Runs an ad-hoc analytics query written in EQL (Exponea Query Language) against a project. Nothing is saved in the project — the result is computed and returned.
The query must be a select report query or a funnel query. Examples:
select count customers by customer.countryselect sum event purchase.revenuefunnel session_start followed by purchase
Standalone metric expressions (such as count event purchase) are not executable on their own. Wrap them in a select, like select count event purchase.
EQL parse errors are returned as success: false with the parser's message in the error field — they are not raised as exceptions.
Request parameters
| Name | Type | Required? | Description |
|---|---|---|---|
project_id | str | Yes | The project ID returned by list_projects. |
query | str | Yes | The EQL query string. Must be a select report query or a funnel query. |
execution_time | int | null | No | A Unix timestamp (in seconds) used as the upper boundary for events to consider. Defaults to the current time. |
Response parameters
The tool returns an EqlExecutionResponse object with the following parameters:
| Parameter | Type | Description |
|---|---|---|
success | bool | Whether the query was parsed and computed successfully. |
query | str | The EQL query string that was executed. |
analysis_type | str | null | The analysis type inferred from the EQL query: report, trend, or funnel. Null if parsing failed before the type could be determined. |
data | any | null | The computed result. The shape depends on analysis_type. For reports: rows with headers and metric values. For funnels: step-by-step conversion counts and rates. |
error | str | null | Error message if parsing or computation failed. |
Updated 28 minutes ago
