CloudWatchLogs / Paginator / DescribeLogGroups

DescribeLogGroups#

class CloudWatchLogs.Paginator.DescribeLogGroups#
paginator = client.get_paginator('describe_log_groups')
paginate(**kwargs)#

Creates an iterator that will paginate through responses from CloudWatchLogs.Client.describe_log_groups().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    accountIdentifiers=[
        'string',
    ],
    logGroupNamePrefix='string',
    logGroupNamePattern='string',
    includeLinkedAccounts=True|False,
    logGroupClass='STANDARD'|'INFREQUENT_ACCESS',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • accountIdentifiers (list) –

    When includeLinkedAccounts is set to True, use this parameter to specify the list of accounts to search. You can specify as many as 20 account IDs in the array.

    • (string) –

  • logGroupNamePrefix (string) –

    The prefix to match.

    Note

    logGroupNamePrefix and logGroupNamePattern are mutually exclusive. Only one of these parameters can be passed.

  • logGroupNamePattern (string) –

    If you specify a string for this parameter, the operation returns only log groups that have names that match the string based on a case-sensitive substring search. For example, if you specify Foo, log groups named FooBar, aws/Foo, and GroupFoo would match, but foo, F/o/o and Froo would not match.

    If you specify logGroupNamePattern in your request, then only arn, creationTime, and logGroupName are included in the response.

    Note

    logGroupNamePattern and logGroupNamePrefix are mutually exclusive. Only one of these parameters can be passed.

  • includeLinkedAccounts (boolean) –

    If you are using a monitoring account, set this to True to have the operation return log groups in the accounts listed in accountIdentifiers.

    If this parameter is set to true and accountIdentifiers contains a null value, the operation returns all log groups in the monitoring account and all log groups in all source accounts that are linked to the monitoring account.

  • logGroupClass (string) –

    Specifies the log group class for this log group. There are two classes:

    • The Standard log class supports all CloudWatch Logs features.

    • The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower costs.

    For details about the features supported by each class, see Log classes

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) –

      The size of each page.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:

dict

Returns:

Response Syntax

{
    'logGroups': [
        {
            'logGroupName': 'string',
            'creationTime': 123,
            'retentionInDays': 123,
            'metricFilterCount': 123,
            'arn': 'string',
            'storedBytes': 123,
            'kmsKeyId': 'string',
            'dataProtectionStatus': 'ACTIVATED'|'DELETED'|'ARCHIVED'|'DISABLED',
            'inheritedProperties': [
                'ACCOUNT_DATA_PROTECTION',
            ],
            'logGroupClass': 'STANDARD'|'INFREQUENT_ACCESS',
            'logGroupArn': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • logGroups (list) –

      The log groups.

      If the retentionInDays value is not included for a log group, then that log group’s events do not expire.

      • (dict) –

        Represents a log group.

        • logGroupName (string) –

          The name of the log group.

        • creationTime (integer) –

          The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.

        • retentionInDays (integer) –

          The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.

          To set a log group so that its log events do not expire, use DeleteRetentionPolicy.

        • metricFilterCount (integer) –

          The number of metric filters.

        • arn (string) –

          The Amazon Resource Name (ARN) of the log group. This version of the ARN includes a trailing :* after the log group name.

          Use this version to refer to the ARN in IAM policies when specifying permissions for most API actions. The exception is when specifying permissions for TagResource, UntagResource, and ListTagsForResource. The permissions for those three actions require the ARN version that doesn’t include a trailing :*.

        • storedBytes (integer) –

          The number of bytes stored.

        • kmsKeyId (string) –

          The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data.

        • dataProtectionStatus (string) –

          Displays whether this log group has a protection policy, or whether it had one in the past. For more information, see PutDataProtectionPolicy.

        • inheritedProperties (list) –

          Displays all the properties that this log group has inherited from account-level settings.

          • (string) –

        • logGroupClass (string) –

          This specifies the log group class for this log group. There are two classes:

          • The Standard log class supports all CloudWatch Logs features.

          • The Infrequent Access log class supports a subset of CloudWatch Logs features and incurs lower costs.

          For details about the features supported by each class, see Log classes

        • logGroupArn (string) –

          The Amazon Resource Name (ARN) of the log group. This version of the ARN doesn’t include a trailing :* after the log group name.

          Use this version to refer to the ARN in the following situations:

    • NextToken (string) –

      A token to resume pagination.