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

Description

Uploads a batch of log events to the specified log stream.

The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are always accepted and never return InvalidSequenceTokenException or DataAlreadyAcceptedException even if the sequence token is not valid. You can use parallel PutLogEvents actions on the same log stream.

The batch of events must satisfy the following constraints:

  • The maximum batch size is 1,048,576 bytes. This size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event.
  • None of the log events in the batch can be more than 2 hours in the future.
  • None of the log events in the batch can be more than 14 days in the past. Also, none of the log events can be from earlier than the retention period of the log group.
  • The log events in the batch must be in chronological order by their timestamp. The timestamp is the time that the event occurred, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. (In Amazon Web Services Tools for PowerShell and the Amazon Web Services SDK for .NET, the timestamp is specified in .NET format: yyyy-mm-ddThh:mm:ss. For example, 2017-09-15T13:45:30.)
  • A batch of log events in a single request cannot span more than 24 hours. Otherwise, the operation fails.
  • The maximum number of log events in a batch is 10,000.
  • The quota of five requests per second per log stream has been removed. Instead, PutLogEvents actions are throttled based on a per-second per-account quota. You can request an increase to the per-second throttling quota by using the Service Quotas service.

If a call to PutLogEvents returns "UnrecognizedClientException" the most likely cause is a non-valid Amazon Web Services access key ID or secret key.

Synopsis

Creating a Request

data PutLogEvents Source #

See: newPutLogEvents smart constructor.

Constructors

PutLogEvents' 

Fields

  • sequenceToken :: Maybe Text

    The sequence token obtained from the response of the previous PutLogEvents call.

    The sequenceToken parameter is now ignored in PutLogEvents actions. PutLogEvents actions are now accepted and never return InvalidSequenceTokenException or DataAlreadyAcceptedException even if the sequence token is not valid.

  • logGroupName :: Text

    The name of the log group.

  • logStreamName :: Text

    The name of the log stream.

  • logEvents :: NonEmpty InputLogEvent

    The log events.

Instances

Instances details
ToJSON PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

ToHeaders PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

ToPath PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

ToQuery PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

AWSRequest PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Associated Types

type AWSResponse PutLogEvents #

Generic PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Associated Types

type Rep PutLogEvents :: Type -> Type #

Read PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Show PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

NFData PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Methods

rnf :: PutLogEvents -> () #

Eq PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Hashable PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

type AWSResponse PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

type Rep PutLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

type Rep PutLogEvents = D1 ('MetaData "PutLogEvents" "Amazonka.CloudWatchLogs.PutLogEvents" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "PutLogEvents'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sequenceToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "logGroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "logStreamName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "logEvents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NonEmpty InputLogEvent)))))

newPutLogEvents Source #

Create a value of PutLogEvents 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:sequenceToken:PutLogEvents', putLogEvents_sequenceToken - The sequence token obtained from the response of the previous PutLogEvents call.

The sequenceToken parameter is now ignored in PutLogEvents actions. PutLogEvents actions are now accepted and never return InvalidSequenceTokenException or DataAlreadyAcceptedException even if the sequence token is not valid.

PutLogEvents, putLogEvents_logGroupName - The name of the log group.

PutLogEvents, putLogEvents_logStreamName - The name of the log stream.

$sel:logEvents:PutLogEvents', putLogEvents_logEvents - The log events.

Request Lenses

putLogEvents_sequenceToken :: Lens' PutLogEvents (Maybe Text) Source #

The sequence token obtained from the response of the previous PutLogEvents call.

The sequenceToken parameter is now ignored in PutLogEvents actions. PutLogEvents actions are now accepted and never return InvalidSequenceTokenException or DataAlreadyAcceptedException even if the sequence token is not valid.

Destructuring the Response

data PutLogEventsResponse Source #

See: newPutLogEventsResponse smart constructor.

Constructors

PutLogEventsResponse' 

Fields

  • nextSequenceToken :: Maybe Text

    The next sequence token.

    This field has been deprecated.

    The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are always accepted even if the sequence token is not valid. You can use parallel PutLogEvents actions on the same log stream and you do not need to wait for the response of a previous PutLogEvents action to obtain the nextSequenceToken value.

  • rejectedLogEventsInfo :: Maybe RejectedLogEventsInfo

    The rejected events.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic PutLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Associated Types

type Rep PutLogEventsResponse :: Type -> Type #

Read PutLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Show PutLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

NFData PutLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

Methods

rnf :: PutLogEventsResponse -> () #

Eq PutLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

type Rep PutLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutLogEvents

type Rep PutLogEventsResponse = D1 ('MetaData "PutLogEventsResponse" "Amazonka.CloudWatchLogs.PutLogEvents" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "PutLogEventsResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "nextSequenceToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "rejectedLogEventsInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RejectedLogEventsInfo)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newPutLogEventsResponse Source #

Create a value of PutLogEventsResponse 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:nextSequenceToken:PutLogEventsResponse', putLogEventsResponse_nextSequenceToken - The next sequence token.

This field has been deprecated.

The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are always accepted even if the sequence token is not valid. You can use parallel PutLogEvents actions on the same log stream and you do not need to wait for the response of a previous PutLogEvents action to obtain the nextSequenceToken value.

$sel:rejectedLogEventsInfo:PutLogEventsResponse', putLogEventsResponse_rejectedLogEventsInfo - The rejected events.

$sel:httpStatus:PutLogEventsResponse', putLogEventsResponse_httpStatus - The response's http status code.

Response Lenses

putLogEventsResponse_nextSequenceToken :: Lens' PutLogEventsResponse (Maybe Text) Source #

The next sequence token.

This field has been deprecated.

The sequence token is now ignored in PutLogEvents actions. PutLogEvents actions are always accepted even if the sequence token is not valid. You can use parallel PutLogEvents actions on the same log stream and you do not need to wait for the response of a previous PutLogEvents action to obtain the nextSequenceToken value.