2020/05/07 - Amazon CloudWatch Logs - 3 new api methods
Changes Amazon CloudWatch Logs now offers the ability to interact with Logs Insights queries via the new PutQueryDefinition, DescribeQueryDefinitions, and DeleteQueryDefinition APIs.
See also: AWS API Documentation
Request Syntax
client.put_query_definition(
name='string',
queryDefinitionId='string',
logGroupNames=[
'string',
],
queryString='string'
)
string
[REQUIRED]
string
list
(string) --
string
[REQUIRED]
dict
Response Syntax
{
'queryDefinitionId': 'string'
}
Response Structure
(dict) --
queryDefinitionId (string) --
See also: AWS API Documentation
Request Syntax
client.describe_query_definitions(
queryDefinitionNamePrefix='string',
maxResults=123,
nextToken='string'
)
string
integer
string
The token for the next set of items to return. The token expires after 24 hours.
dict
Response Syntax
{
'queryDefinitions': [
{
'queryDefinitionId': 'string',
'name': 'string',
'queryString': 'string',
'lastModified': 123,
'logGroupNames': [
'string',
]
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
queryDefinitions (list) --
(dict) --
queryDefinitionId (string) --
name (string) --
queryString (string) --
lastModified (integer) --
logGroupNames (list) --
(string) --
nextToken (string) --
The token for the next set of items to return. The token expires after 24 hours.
See also: AWS API Documentation
Request Syntax
client.delete_query_definition(
queryDefinitionId='string'
)
string
[REQUIRED]
dict
Response Syntax
{
'success': True|False
}
Response Structure
(dict) --
success (boolean) --