Skip to content

CloudWatchLogsClient.list_log_groups

rboto-cloudwatch-logs==0.4.0 · Service index · Types

Model summary (excerpt): Returns a list of log groups in the Region in your account. If you are performing this action in a monitoring account, you can choose to also return 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 . You can...

Install and imports

python -m pip install "rboto[cloudwatch-logs]==0.4.0"
from rboto import CloudWatchLogsClient
from collections.abc import Sequence
from rboto_cloudwatch_logs.types import (
    DataSourceFilter,
    ListLogGroupsOutput,
    LogGroupClass,
    TagFilter,
)

Signature

async def list_log_groups(
    *,
    log_group_name_pattern: str | None = None,
    log_group_class: LogGroupClass | None = None,
    include_linked_accounts: bool | None = None,
    account_identifiers: Sequence[str] | None = None,
    next_token: str | None = None,
    limit: int | None = None,
    data_sources: Sequence[DataSourceFilter] | None = None,
    field_index_names: Sequence[str] | None = None,
    log_group_tags: Sequence[TagFilter] | None = None,
) -> ListLogGroupsOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
log_group_name_pattern No 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...
log_group_class No Use this parameter to limit the results to only those log groups in the specified log group class. If you omit this parameter, log groups of all classes can be returned.
include_linked_accounts No 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...
account_identifiers No 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.
next_token No
limit No The maximum number of log groups to return. If you omit this parameter, the default is up to 50 log groups.
data_sources No An array of data source filters to filter log groups by their associated data sources. You can filter by data source name, type, or both. Multiple filters within the same dimension are combined with OR logic, while filters across different dimensions are combined with AND logic.
field_index_names No An array of field index names to filter log groups that have specific field indexes. Only log groups containing all specified field indexes are returned. You can specify 1 to 20 field index names, each with 1 to 512 characters.
log_group_tags No An array of tag filters to return only log groups that have specific tags. Multiple filters are combined with AND logic.

Output

ListLogGroupsOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
log_groups list[LogGroupSummaryOutput] | None Always present LogGroupSummaryOutput
next_token str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

DataSourceFilter, ListLogGroupsOutput, LogGroupClass, TagFilter

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_cloudwatch_logs.exceptions:

InvalidParameterError, ServiceUnavailableError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model