Skip to content

CloudWatchLogsClient.get_log_events

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

Model summary (excerpt): Lists log events from the specified log stream. You can list all of the log events or filter using a time range. GetLogEvents is a paginated operation. Each page returned can contain up to 1 MB of log events or up to 10,000 log events. A returned page might only be partially full, or even empty. For example, if the result of a query would return 15,000 log events, the first page isn't...

Install and imports

python -m pip install "rboto[cloudwatch-logs]==0.4.0"
from rboto import CloudWatchLogsClient
from rboto_cloudwatch_logs.types import (
    GetLogEventsOutput,
)

Signature

async def get_log_events(
    *,
    log_stream_name: str,
    log_group_name: str | None = None,
    log_group_identifier: str | None = None,
    start_time: int | None = None,
    end_time: int | None = None,
    next_token: str | None = None,
    limit: int | None = None,
    start_from_head: bool | None = None,
    unmask: bool | None = None,
) -> GetLogEventsOutput: ...

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_stream_name Yes The name of the log stream.
log_group_name No The name of the log group. You must include either logGroupIdentifier or logGroupName , but not both.
log_group_identifier No Specify either the name or ARN of the log group to view events from. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN. You must include either logGroupIdentifier or logGroupName , but not both.
start_time No The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC . Events with a timestamp equal to this time or later than this time are included. Events with a timestamp earlier than this time are not included. Set startTime explicitly to reduce the chances of empty pages in the response.
end_time No The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC . Events with a timestamp equal to or later than this time are not included.
next_token No The token for the next set of items to return. (You received this token from a previous call.)
limit No The maximum number of log events returned. If you don't specify a limit, the default is as many log events as can fit in a response size of 1 MB (up to 10,000 log events).
start_from_head No If the value is true, the earliest log events are returned first. If the value is false, the latest log events are returned first. The default value is false. If you are using a previous nextForwardToken value as the nextToken in this operation, you must specify true for startFromHead .
unmask No Specify true to display the log event fields with all sensitive data unmasked and visible. The default is false . To use this operation with this parameter, you must be signed into an account with the logs:Unmask permission.

Output

GetLogEventsOutput.

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
events list[OutputLogEventOutput] | None Always present OutputLogEventOutput
next_forward_token str | None Always present —
next_backward_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.

GetLogEventsOutput

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

Pagination and streaming

client.paginators.get_log_events(...) accepts the same arguments and returns AsyncIterator[GetLogEventsOutput]. Direct calls return one page. Pages preserve the Output representation above.

Input cursors: next_token. Page-size argument: limit.

No output stream.

Errors

Import from rboto_cloudwatch_logs.exceptions:

InvalidParameterError, ResourceNotFoundError, ServiceUnavailableError.

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

Service guide · Pinned model