2015/09/17 - Amazon CloudWatch Logs - 3 new api methods
Creates an ExportTask which allows you to efficiently export data from a Log Group to your Amazon S3 bucket.
This is an asynchronous call. If all the required information is provided, this API will initiate an export task and respond with the task Id. Once started, DescribeExportTasks can be used to get the status of an export task.
Request Syntax
client.create_export_task( taskName='string', logGroupName='string', logStreamNamePrefix='string', from=123, to=123, destination='string', destinationPrefix='string' )
string
The name of the export task.
string
[REQUIRED]
The name of the log group to export.
string
Will only export log streams that match the provided logStreamNamePrefix. If you don't specify a value, no prefix filter is applied.
integer
[REQUIRED]
A unix timestamp indicating the start time of the range for the request. Events with a timestamp prior to this time will not be exported.
integer
[REQUIRED]
A unix timestamp indicating the end time of the range for the request. Events with a timestamp later than this time will not be exported.
string
[REQUIRED]
Name of Amazon S3 bucket to which the log data will be exported. NOTE: Only buckets in the same AWS region are supported
string
Prefix that will be used as the start of Amazon S3 key for every object exported. If not specified, this defaults to 'exportedlogs'.
dict
Response Syntax
{ 'taskId': 'string' }
Response Structure
(dict) --
taskId (string) --
Id of the export task that got created.
Cancels an export task if it is in PENDING or RUNNING state.
Request Syntax
client.cancel_export_task( taskId='string' )
string
[REQUIRED]
Id of the export task to cancel.
None
Returns all the export tasks that are associated with the AWS account making the request. The export tasks can be filtered based on TaskId or TaskStatus.
By default, this operation returns up to 50 export tasks that satisfy the specified filters. If there are more export tasks to list, the response would contain a nextToken value in the response body. You can also limit the number of export tasks returned in the response by specifying the limit parameter in the request.
Request Syntax
client.describe_export_tasks( taskId='string', statusCode='CANCELLED'|'COMPLETED'|'FAILED'|'PENDING'|'PENDING_CANCEL'|'RUNNING', nextToken='string', limit=123 )
string
Export task that matches the specified task Id will be returned. This can result in zero or one export task.
string
All export tasks that matches the specified status code will be returned. This can return zero or more export tasks.
string
A string token used for pagination that points to the next page of results. It must be a value obtained from the response of the previous DescribeExportTasks request.
integer
The maximum number of items returned in the response. If you don't specify a value, the request would return up to 50 items.
dict
Response Syntax
{ 'exportTasks': [ { 'taskId': 'string', 'taskName': 'string', 'logGroupName': 'string', 'from': 123, 'to': 123, 'destination': 'string', 'destinationPrefix': 'string', 'status': { 'code': 'CANCELLED'|'COMPLETED'|'FAILED'|'PENDING'|'PENDING_CANCEL'|'RUNNING', 'message': 'string' }, 'executionInfo': { 'creationTime': 123, 'completionTime': 123 } }, ], 'nextToken': 'string' }
Response Structure
(dict) --
exportTasks (list) --
A list of export tasks.
(dict) --
Represents an export task.
taskId (string) --
Id of the export task.
taskName (string) --
The name of the export task.
logGroupName (string) --
The name of the log group from which logs data was exported.
from (integer) --
A unix timestamp indicating the start time of the range for the request. Events with a timestamp prior to this time were not exported.
to (integer) --
A unix timestamp indicating the end time of the range for the request. Events with a timestamp later than this time were not exported.
destination (string) --
Name of Amazon S3 bucket to which the log data was exported.
destinationPrefix (string) --
Prefix that was used as the start of Amazon S3 key for every object exported.
status (dict) --
Status of the export task.
code (string) --
Status code of the export task.
message (string) --
Status message related to the code.
executionInfo (dict) --
Execution info about the export task.
creationTime (integer) --
A point in time when the export task got created.
completionTime (integer) --
A point in time when the export task got completed.
nextToken (string) --
A string token used for pagination that points to the next page of results. It must be a value obtained from the response of the previous request. The token expires after 24 hours.