all_logs
Creates, updates, deletes, gets or lists an all_logs resource.
Overview​
| Name | all_logs |
| Type | Resource |
| Id | supabase.analytics.all_logs |
Fields​
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
error | string | |
result | array |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | ref | sql, iso_timestamp_start, iso_timestamp_end | Executes a SQL query on the project's logs.<br /><br />Either the iso_timestamp_start and iso_timestamp_end parameters must be provided.<br />If both are not provided, only the last 1 minute of logs will be queried.<br />The timestamp range must be no more than 24 hours and is rounded to the nearest minute. If the range is more than 24 hours, a validation error will be thrown.<br /><br />Note: Unless the sql parameter is provided, only edge_logs will be queried. See the [log query docs](https:​//supabase.com/docs/guides/monitoring-and-debugging/logs#logs-explorer) for all available sources.<br /> |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
ref | string | Supabase project reference (the Project ID shown in the dashboard under Settings -> General; 20 lowercase letters). Resolved from the SUPABASE_PROJECT_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every project-scoped query as WHERE ref = '<ref>'. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: SUPABASE_PROJECT_ID) |
iso_timestamp_end | string (date-time) | |
iso_timestamp_start | string (date-time) | |
sql | string | Custom SQL query to execute on the logs. See [querying logs](https:​//supabase.com/docs/guides/monitoring-and-debugging/logs#querying-with-the-logs-explorer) for more details. |
SELECT examples​
- get
Executes a SQL query on the project's logs.<br /><br />Either the iso_timestamp_start and iso_timestamp_end parameters must be provided.<br />If both are not provided, only the last 1 minute of logs will be queried.<br />The timestamp range must be no more than 24 hours and is rounded to the nearest minute. If the range is more than 24 hours, a validation error will be thrown.<br /><br />Note: Unless the sql parameter is provided, only edge_logs will be queried. See the [log query docs](https:​//supabase.com/docs/guides/monitoring-and-debugging/logs#logs-explorer) for all available sources.<br />
SELECT
error,
result
FROM supabase.analytics.all_logs
WHERE ref = '{{ ref }}' -- required unless SUPABASE_PROJECT_ID is set
AND sql = '{{ sql }}'
AND iso_timestamp_start = '{{ iso_timestamp_start }}'
AND iso_timestamp_end = '{{ iso_timestamp_end }}'
;