amazonka-cloudwatch-logs-2.0: Amazon CloudWatch Logs SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.CloudWatchLogs.GetLogEvents

Description

Lists log events from the specified log stream. You can list all of the log events or filter using a time range.

By default, this operation returns as many log events as can fit in a response size of 1MB (up to 10,000 log events). You can get additional log events by specifying one of the tokens in a subsequent call. This operation can return empty results while there are more log events available through the token.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.

Synopsis

Creating a Request

data GetLogEvents Source #

See: newGetLogEvents smart constructor.

Constructors

GetLogEvents' 

Fields

  • endTime :: Maybe Natural

    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.

  • limit :: Maybe Natural

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

  • logGroupIdentifier :: Maybe Text

    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.

    If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

  • nextToken :: Maybe Text

    The token for the next set of items to return. (You received this token from a previous call.)

  • startFromHead :: Maybe Bool

    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.

  • startTime :: Maybe Natural

    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.

  • unmask :: Maybe Bool

    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.

  • logGroupName :: Text

    The name of the log group.

    If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

  • logStreamName :: Text

    The name of the log stream.

Instances

Instances details
ToJSON GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

ToHeaders GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

ToPath GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

ToQuery GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

AWSRequest GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Associated Types

type AWSResponse GetLogEvents #

Generic GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Associated Types

type Rep GetLogEvents :: Type -> Type #

Read GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Show GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

NFData GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Methods

rnf :: GetLogEvents -> () #

Eq GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Hashable GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

type AWSResponse GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

type Rep GetLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

newGetLogEvents Source #

Create a value of GetLogEvents with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:endTime:GetLogEvents', getLogEvents_endTime - 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.

$sel:limit:GetLogEvents', getLogEvents_limit - 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).

$sel:logGroupIdentifier:GetLogEvents', getLogEvents_logGroupIdentifier - 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.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

$sel:nextToken:GetLogEvents', getLogEvents_nextToken - The token for the next set of items to return. (You received this token from a previous call.)

$sel:startFromHead:GetLogEvents', getLogEvents_startFromHead - 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.

$sel:startTime:GetLogEvents', getLogEvents_startTime - 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.

$sel:unmask:GetLogEvents', getLogEvents_unmask - 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.

GetLogEvents, getLogEvents_logGroupName - The name of the log group.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

GetLogEvents, getLogEvents_logStreamName - The name of the log stream.

Request Lenses

getLogEvents_endTime :: Lens' GetLogEvents (Maybe Natural) Source #

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.

getLogEvents_limit :: Lens' GetLogEvents (Maybe Natural) Source #

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

getLogEvents_logGroupIdentifier :: Lens' GetLogEvents (Maybe Text) Source #

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.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

getLogEvents_nextToken :: Lens' GetLogEvents (Maybe Text) Source #

The token for the next set of items to return. (You received this token from a previous call.)

getLogEvents_startFromHead :: Lens' GetLogEvents (Maybe Bool) Source #

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.

getLogEvents_startTime :: Lens' GetLogEvents (Maybe Natural) Source #

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.

getLogEvents_unmask :: Lens' GetLogEvents (Maybe Bool) Source #

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.

getLogEvents_logGroupName :: Lens' GetLogEvents Text Source #

The name of the log group.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

Destructuring the Response

data GetLogEventsResponse Source #

See: newGetLogEventsResponse smart constructor.

Constructors

GetLogEventsResponse' 

Fields

  • events :: Maybe [OutputLogEvent]

    The events.

  • nextBackwardToken :: Maybe Text

    The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.

  • nextForwardToken :: Maybe Text

    The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic GetLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Associated Types

type Rep GetLogEventsResponse :: Type -> Type #

Read GetLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Show GetLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

NFData GetLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

Methods

rnf :: GetLogEventsResponse -> () #

Eq GetLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

type Rep GetLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetLogEvents

type Rep GetLogEventsResponse = D1 ('MetaData "GetLogEventsResponse" "Amazonka.CloudWatchLogs.GetLogEvents" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "GetLogEventsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "events") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [OutputLogEvent])) :*: S1 ('MetaSel ('Just "nextBackwardToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "nextForwardToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newGetLogEventsResponse Source #

Create a value of GetLogEventsResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:events:GetLogEventsResponse', getLogEventsResponse_events - The events.

$sel:nextBackwardToken:GetLogEventsResponse', getLogEventsResponse_nextBackwardToken - The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.

$sel:nextForwardToken:GetLogEventsResponse', getLogEventsResponse_nextForwardToken - The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.

$sel:httpStatus:GetLogEventsResponse', getLogEventsResponse_httpStatus - The response's http status code.

Response Lenses

getLogEventsResponse_nextBackwardToken :: Lens' GetLogEventsResponse (Maybe Text) Source #

The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.

getLogEventsResponse_nextForwardToken :: Lens' GetLogEventsResponse (Maybe Text) Source #

The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.