queries
Creates, updates, deletes, gets or lists a queries resource.
Overview
| Name | queries |
| Type | Resource |
| Id | aws.logs.queries |
Fields
The following fields are returned by SELECT queries:
- describe_queries
| Name | Datatype | Description |
|---|---|---|
bytes_scanned | number (double) | The total number of bytes scanned by the query. This indicates the cost associated with the query. |
create_time | integer (int64) | The date and time that this query was created. |
log_group_name | string | The name of the log group scanned by this query. (pattern: <code>[.-_/#A-Za-z0-9]+</code>) |
query_duration | integer (int64) | The duration in milliseconds that the query took to execute. |
query_id | string | The unique ID number of this query. |
query_language | string | The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see Supported query languages. (CWLI, SQL, PPL) |
query_string | string | The query string used in this query. |
status | string | The status of this query. Possible values are Cancelled, Complete, Failed, Running, Scheduled, and Unknown. (Scheduled, Running, Complete, Failed, Cancelled, Timeout, Unknown) |
user_identity | string | The ARN of the user who ran the query. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_queries | select | region | Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account. You can request all queries or limit it to queries of a specific log group or queries with a certain status. This operation includes both interactive queries started directly by users and automated queries executed by scheduled query configurations. Scheduled query executions appear in the results alongside manually initiated queries, providing visibility into all query activity in your account. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_queries
Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account. You can request all queries or limit it to queries of a specific log group or queries with a certain status. This operation includes both interactive queries started directly by users and automated queries executed by scheduled query configurations. Scheduled query executions appear in the results alongside manually initiated queries, providing visibility into all query activity in your account.
SELECT
bytes_scanned,
create_time,
log_group_name,
query_duration,
query_id,
query_language,
query_string,
status,
user_identity
FROM aws.logs.queries
WHERE region = '{{ region }}' -- required
;