CloudWatchLogs / Client / list_aggregate_log_group_summaries

list_aggregate_log_group_summaries

CloudWatchLogs.Client.list_aggregate_log_group_summaries(**kwargs)

Returns an aggregate summary of all log groups in the Region grouped by specified data source characteristics. Supports optional filtering by log group class, name patterns, and data sources. If you perform this action in a monitoring account, you can also return aggregated summaries of log groups from source accounts that are linked to the monitoring account. For more information about using cross-account observability to set up monitoring accounts and source accounts, see CloudWatch cross-account observability.

The operation aggregates log groups by data source name and type and optionally format, providing counts of log groups that share these characteristics. The operation paginates results. By default, it returns up to 50 results and includes a token to retrieve more results.

See also: AWS API Documentation

Request Syntax

response = client.list_aggregate_log_group_summaries(
    accountIdentifiers=[
        'string',
    ],
    includeLinkedAccounts=True|False,
    logGroupClass='STANDARD'|'INFREQUENT_ACCESS'|'DELIVERY',
    logGroupNamePattern='string',
    dataSources=[
        {
            'name': 'string',
            'type': 'string'
        },
    ],
    groupBy='DATA_SOURCE_NAME_TYPE_AND_FORMAT'|'DATA_SOURCE_NAME_AND_TYPE',
    nextToken='string',
    limit=123
)
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) –

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

    The default for this parameter is false.

  • logGroupClass (string) – Filters the results by log group class to include only log groups of the specified class.

  • logGroupNamePattern (string) –

    Use this parameter to limit the returned log groups to only those with names that match the pattern that you specify. This parameter is a regular expression that can match prefixes and substrings, and supports wildcard matching and matching multiple patterns, as in the following examples.

    • Use ^ to match log group names by prefix.

    • For a substring match, specify the string to match. All matches are case sensitive

    • To match multiple patterns, separate them with a | as in the example ^/aws/lambda|discovery

    You can specify as many as five different regular expression patterns in this field, each of which must be between 3 and 24 characters. You can include the ^ symbol as many as five times, and include the | symbol as many as four times.

  • dataSources (list) –

    Filters the results by data source characteristics to include only log groups associated with the specified data sources.

    • (dict) –

      Filter criteria for data sources, used to specify which data sources to include in operations based on name and type.

      • name (string) – [REQUIRED]

        The name pattern to filter data sources by.

      • type (string) –

        The type pattern to filter data sources by.

  • groupBy (string) –

    [REQUIRED]

    Specifies how to group the log groups in the summary.

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

  • limit (integer) – The maximum number of aggregated summaries to return. If you omit this parameter, the default is up to 50 aggregated summaries.

Return type:

dict

Returns:

Response Syntax

{
    'aggregateLogGroupSummaries': [
        {
            'logGroupCount': 123,
            'groupingIdentifiers': [
                {
                    'key': 'string',
                    'value': 'string'
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • aggregateLogGroupSummaries (list) –

      The list of aggregate log group summaries grouped by the specified data source characteristics.

      • (dict) –

        Contains an aggregate summary of log groups grouped by data source characteristics, including the count of log groups and their grouping identifiers.

        • logGroupCount (integer) –

          The number of log groups in this aggregate summary group.

        • groupingIdentifiers (list) –

          An array of key-value pairs that identify the data source characteristics used to group the log groups.

          The size and content of this array depends on the groupBy parameter specified in the request.

          • (dict) –

            A key-value pair that identifies how log groups are grouped in aggregate summaries.

            • key (string) –

              The key that identifies the grouping characteristic. The format of the key uses dot notation. Examples are, dataSource.Name, dataSource.Type, and dataSource.Format.

            • value (string) –

              The value associated with the grouping characteristic. Examples are amazon_vpc, flow, and OCSF.

    • nextToken (string) –

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

Exceptions

  • CloudWatchLogs.Client.exceptions.ValidationException

  • CloudWatchLogs.Client.exceptions.ServiceUnavailableException

  • CloudWatchLogs.Client.exceptions.InvalidParameterException