CloudWatchLogs / Client / describe_queries

describe_queries#

CloudWatchLogs.Client.describe_queries(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.describe_queries(
    logGroupName='string',
    status='Scheduled'|'Running'|'Complete'|'Failed'|'Cancelled'|'Timeout'|'Unknown',
    maxResults=123,
    nextToken='string',
    queryLanguage='CWLI'|'SQL'|'PPL'
)
Parameters:
  • logGroupName (string) – Limits the returned queries to only those for the specified log group.

  • status (string) – Limits the returned queries to only those that have the specified status. Valid values are Cancelled, Complete, Failed, Running, and Scheduled.

  • maxResults (integer) – Limits the number of returned queries to the specified number.

  • nextToken (string) – The token for the next set of items to return. The token expires after 24 hours.

  • queryLanguage (string) – Limits the returned queries to only the queries that use the specified query language.

Return type:

dict

Returns:

Response Syntax

{
    'queries': [
        {
            'queryLanguage': 'CWLI'|'SQL'|'PPL',
            'queryId': 'string',
            'queryString': 'string',
            'status': 'Scheduled'|'Running'|'Complete'|'Failed'|'Cancelled'|'Timeout'|'Unknown',
            'createTime': 123,
            'logGroupName': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • queries (list) –

      The list of queries that match the request.

      • (dict) –

        Information about one CloudWatch Logs Insights query that matches the request in a DescribeQueries operation.

        • queryLanguage (string) –

          The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see Supported query languages.

        • queryId (string) –

          The unique ID number of this query.

        • queryString (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.

        • createTime (integer) –

          The date and time that this query was created.

        • logGroupName (string) –

          The name of the log group scanned by this query.

    • nextToken (string) –

      The token for the next set of items to return. The token expires after 24 hours.

Exceptions

  • CloudWatchLogs.Client.exceptions.InvalidParameterException

  • CloudWatchLogs.Client.exceptions.ResourceNotFoundException

  • CloudWatchLogs.Client.exceptions.ServiceUnavailableException