CloudWatchLogsClient.list_log_groups_for_query
rboto-cloudwatch-logs==0.4.0 · Service index · Types
Model summary (excerpt): Returns a list of the log groups that were analyzed during a single CloudWatch Logs Insights query. This can be useful for queries that use log group name prefixes or the filterIndex command, because the log groups are dynamically selected in these cases. For more information about field indexes, see Create field indexes to improve query performance and reduce costs .
Install and imports
from rboto import CloudWatchLogsClient
from rboto_cloudwatch_logs.types import (
ListLogGroupsForQueryOutput,
)
Signature
async def list_log_groups_for_query(
*,
query_id: str,
next_token: str | None = None,
max_results: int | None = None,
) -> ListLogGroupsForQueryOutput: ...
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) |
|---|---|---|
query_id |
Yes | The ID of the query to use. This query ID is from the response to your StartQuery operation. |
next_token |
No | |
max_results |
No | Limits the number of returned log groups to the specified number. |
Output
ListLogGroupsForQueryOutput.
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_group_identifiers |
list[str] | None |
Always present | — |
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.
Related types
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
client.paginators.list_log_groups_for_query(...) accepts the same arguments and returns AsyncIterator[ListLogGroupsForQueryOutput]. Direct calls return one page. Pages preserve the Output representation above.
Input cursors: next_token. Page-size argument: max_results.
No output stream.
Errors
Import from rboto_cloudwatch_logs.exceptions:
AccessDeniedError, InvalidParameterError, ResourceNotFoundError, ServiceUnavailableError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.