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

Description

Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket. When you perform a CreateExportTask operation, you must use credentials that have permission to write to the S3 bucket that you specify as the destination.

Exporting log data to S3 buckets that are encrypted by KMS is supported. Exporting log data to Amazon S3 buckets that have S3 Object Lock enabled with a retention period is also supported.

Exporting to S3 buckets that are encrypted with AES-256 is supported.

This is an asynchronous call. If all the required information is provided, this operation initiates an export task and responds with the ID of the task. After the task has started, you can use DescribeExportTasks to get the status of the export task. Each account can only have one active (RUNNING or PENDING) export task at a time. To cancel an export task, use CancelExportTask.

You can export logs from multiple log groups or multiple time ranges to the same S3 bucket. To separate log data for each export task, specify a prefix to be used as the Amazon S3 key prefix for all exported objects.

Time-based sorting on chunks of log data inside an exported file is not guaranteed. You can sort the exported log field data by using Linux utilities.

Synopsis

Creating a Request

data CreateExportTask Source #

See: newCreateExportTask smart constructor.

Constructors

CreateExportTask' 

Fields

  • destinationPrefix :: Maybe Text

    The prefix used as the start of the key for every object exported. If you don't specify a value, the default is exportedlogs.

  • logStreamNamePrefix :: Maybe Text

    Export only log streams that match the provided prefix. If you don't specify a value, no prefix filter is applied.

  • taskName :: Maybe Text

    The name of the export task.

  • logGroupName :: Text

    The name of the log group.

  • from :: Natural

    The start time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp earlier than this time are not exported.

  • to :: Natural

    The end time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not exported.

    You must specify a time that is not earlier than when this log group was created.

  • destination :: Text

    The name of S3 bucket for the exported log data. The bucket must be in the same Amazon Web Services Region.

Instances

Instances details
ToJSON CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

ToHeaders CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

ToPath CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

ToQuery CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

AWSRequest CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Associated Types

type AWSResponse CreateExportTask #

Generic CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Associated Types

type Rep CreateExportTask :: Type -> Type #

Read CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Show CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

NFData CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Methods

rnf :: CreateExportTask -> () #

Eq CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Hashable CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

type AWSResponse CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

type Rep CreateExportTask Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

type Rep CreateExportTask = D1 ('MetaData "CreateExportTask" "Amazonka.CloudWatchLogs.CreateExportTask" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "CreateExportTask'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "destinationPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "logStreamNamePrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "taskName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "logGroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "from") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural)) :*: (S1 ('MetaSel ('Just "to") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "destination") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newCreateExportTask Source #

Create a value of CreateExportTask 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:

CreateExportTask, createExportTask_destinationPrefix - The prefix used as the start of the key for every object exported. If you don't specify a value, the default is exportedlogs.

$sel:logStreamNamePrefix:CreateExportTask', createExportTask_logStreamNamePrefix - Export only log streams that match the provided prefix. If you don't specify a value, no prefix filter is applied.

CreateExportTask, createExportTask_taskName - The name of the export task.

CreateExportTask, createExportTask_logGroupName - The name of the log group.

CreateExportTask, createExportTask_from - The start time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp earlier than this time are not exported.

CreateExportTask, createExportTask_to - The end time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not exported.

You must specify a time that is not earlier than when this log group was created.

CreateExportTask, createExportTask_destination - The name of S3 bucket for the exported log data. The bucket must be in the same Amazon Web Services Region.

Request Lenses

createExportTask_destinationPrefix :: Lens' CreateExportTask (Maybe Text) Source #

The prefix used as the start of the key for every object exported. If you don't specify a value, the default is exportedlogs.

createExportTask_logStreamNamePrefix :: Lens' CreateExportTask (Maybe Text) Source #

Export only log streams that match the provided prefix. If you don't specify a value, no prefix filter is applied.

createExportTask_from :: Lens' CreateExportTask Natural Source #

The start time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp earlier than this time are not exported.

createExportTask_to :: Lens' CreateExportTask Natural Source #

The end time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not exported.

You must specify a time that is not earlier than when this log group was created.

createExportTask_destination :: Lens' CreateExportTask Text Source #

The name of S3 bucket for the exported log data. The bucket must be in the same Amazon Web Services Region.

Destructuring the Response

data CreateExportTaskResponse Source #

See: newCreateExportTaskResponse smart constructor.

Constructors

CreateExportTaskResponse' 

Fields

Instances

Instances details
Generic CreateExportTaskResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Associated Types

type Rep CreateExportTaskResponse :: Type -> Type #

Read CreateExportTaskResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Show CreateExportTaskResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

NFData CreateExportTaskResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

Eq CreateExportTaskResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

type Rep CreateExportTaskResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.CreateExportTask

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

newCreateExportTaskResponse Source #

Create a value of CreateExportTaskResponse 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:

CreateExportTaskResponse, createExportTaskResponse_taskId - The ID of the export task.

$sel:httpStatus:CreateExportTaskResponse', createExportTaskResponse_httpStatus - The response's http status code.

Response Lenses