2016/12/14 - Amazon CloudWatch Logs - 3 new3 updated api methods
Changes Update logs client to latest version
Removes the specified tags from the specified log group.
To list the tags for a log group, use ListTagsLogGroup. To add tags, use UntagLogGroup.
See also: AWS API Documentation
Request Syntax
client.untag_log_group( logGroupName='string', tags=[ 'string', ] )
string
[REQUIRED]
The name of the log group.
list
[REQUIRED]
The tag keys. The corresponding tags are removed from the log group.
(string) --
None
Adds or updates the specified tags for the specified log group.
To list the tags for a log group, use ListTagsLogGroup. To remove tags, use UntagLogGroup.
For more information about tags, see Tag Log Groups in Amazon CloudWatch Logs in the Amazon CloudWatch Logs User Guide.
See also: AWS API Documentation
Request Syntax
client.tag_log_group( logGroupName='string', tags={ 'string': 'string' } )
string
[REQUIRED]
The name of the log group.
dict
[REQUIRED]
The key-value pairs to use for the tags.
(string) --
(string) --
None
Lists the tags for the specified log group.
To add tags, use TagLogGroup. To remove tags, use UntagLogGroup.
See also: AWS API Documentation
Request Syntax
client.list_tags_log_group( logGroupName='string' )
string
[REQUIRED]
The name of the log group.
dict
Response Syntax
{ 'tags': { 'string': 'string' } }
Response Structure
(dict) --
tags (dict) --
The tags.
(string) --
(string) --
{'tags': {'string': 'string'}}
Creates a log group with the specified name.
You can create up to 5000 log groups per account.
You must use the following guidelines when naming a log group:
Log group names must be unique within a region for an AWS account.
Log group names can be between 1 and 512 characters long.
Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), and '.' (period).
See also: AWS API Documentation
Request Syntax
client.create_log_group( logGroupName='string', tags={ 'string': 'string' } )
string
[REQUIRED]
The name of the log group.
dict
The key-value pairs to use for the tags.
(string) --
(string) --
None
{'subscriptionFilters': {'distribution': 'Random | ByLogStream'}}
Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.
See also: AWS API Documentation
Request Syntax
client.describe_subscription_filters( logGroupName='string', filterNamePrefix='string', nextToken='string', limit=123 )
string
[REQUIRED]
The name of the log group.
string
The prefix to match. If you don't specify a value, no prefix filter is applied.
string
The token for the next set of items to return. (You received this token from a previous call.)
integer
The maximum number of items returned. If you don't specify a value, the default is up to 50 items.
dict
Response Syntax
{ 'subscriptionFilters': [ { 'filterName': 'string', 'logGroupName': 'string', 'filterPattern': 'string', 'destinationArn': 'string', 'roleArn': 'string', 'distribution': 'Random'|'ByLogStream', 'creationTime': 123 }, ], 'nextToken': 'string' }
Response Structure
(dict) --
subscriptionFilters (list) --
The subscription filters.
(dict) --
Represents a subscription filter.
filterName (string) --
The name of the subscription filter.
logGroupName (string) --
The name of the log group.
filterPattern (string) --
A symbolic description of how CloudWatch Logs should interpret the data in each log event. For example, a log event may contain timestamps, IP addresses, strings, and so on. You use the filter pattern to specify what to look for in the log event message.
destinationArn (string) --
The Amazon Resource Name (ARN) of the destination.
roleArn (string) --
distribution (string) --
The method used to distribute log data to the destination, when the destination is an Amazon Kinesis stream.
creationTime (integer) --
The creation time of the subscription filter.
nextToken (string) --
The token for the next set of items to return. The token expires after 24 hours.
{'distribution': 'Random | ByLogStream'}
Creates or updates a subscription filter and associates it with the specified log group. Subscription filters allow you to subscribe to a real-time stream of log events ingested through PutLogEvents and have them delivered to a specific destination. Currently, the supported destinations are:
An Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery.
A logical destination that belongs to a different account, for cross-account delivery.
An Amazon Kinesis Firehose stream that belongs to the same account as the subscription filter, for same-account delivery.
An AWS Lambda function that belongs to the same account as the subscription filter, for same-account delivery.
There can only be one subscription filter associated with a log group.
See also: AWS API Documentation
Request Syntax
client.put_subscription_filter( logGroupName='string', filterName='string', filterPattern='string', destinationArn='string', roleArn='string', distribution='Random'|'ByLogStream' )
string
[REQUIRED]
The name of the log group.
string
[REQUIRED]
A name for the subscription filter.
string
[REQUIRED]
A filter pattern for subscribing to a filtered stream of log events.
string
[REQUIRED]
The ARN of the destination to deliver matching log events to. Currently, the supported destinations are:
An Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery.
A logical destination (specified using an ARN) belonging to a different account, for cross-account delivery.
An Amazon Kinesis Firehose stream belonging to the same account as the subscription filter, for same-account delivery.
An AWS Lambda function belonging to the same account as the subscription filter, for same-account delivery.
string
The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery.
string
The method used to distribute log data to the destination, when the destination is an Amazon Kinesis stream. By default, log data is grouped by log stream. For a more even distribution, you can group log data randomly.
None