CloudWatchLogs / Client / describe_query_definitions
describe_query_definitions¶
- CloudWatchLogs.Client.describe_query_definitions(**kwargs)¶
This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions. You can retrieve query definitions from the current account or from a source account that is linked to the current account.
You can use the
queryDefinitionNamePrefixparameter to limit the results to only the query definitions that have names that start with a certain string.See also: AWS API Documentation
Request Syntax
response = client.describe_query_definitions( queryLanguage='CWLI'|'SQL'|'PPL', queryDefinitionNamePrefix='string', maxResults=123, nextToken='string' )
- Parameters:
queryLanguage (string) – The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see Supported query languages.
queryDefinitionNamePrefix (string) – Use this parameter to filter your results to only the query definitions that have names that start with the prefix you specify.
maxResults (integer) – Limits the number of returned query definitions to the specified number.
nextToken (string) – The token for the next set of items to return. The token expires after 24 hours.
- Return type:
dict
- Returns:
Response Syntax
{ 'queryDefinitions': [ { 'queryLanguage': 'CWLI'|'SQL'|'PPL', 'queryDefinitionId': 'string', 'name': 'string', 'queryString': 'string', 'lastModified': 123, 'logGroupNames': [ 'string', ], 'parameters': [ { 'name': 'string', 'defaultValue': 'string', 'description': 'string' }, ] }, ], 'nextToken': 'string' }
Response Structure
(dict) –
queryDefinitions (list) –
The list of query definitions that match your request.
(dict) –
This structure contains details about a saved CloudWatch Logs Insights query definition.
queryLanguage (string) –
The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see Supported query languages.
queryDefinitionId (string) –
The unique ID of the query definition.
name (string) –
The name of the query definition.
queryString (string) –
The query string to use for this definition. For more information, see CloudWatch Logs Insights Query Syntax.
lastModified (integer) –
The date that the query definition was most recently modified.
logGroupNames (list) –
If this query definition contains a list of log groups that it is limited to, that list appears here.
(string) –
parameters (list) –
If this query definition contains a list of query parameters that define placeholder variables for the query string, that list appears here.
(dict) –
This structure defines a query parameter for a saved CloudWatch Logs Insights query definition. Query parameters are supported only for Logs Insights QL queries. They are placeholder variables that you can reference in a query string using the
{{parameterName}}syntax. Each parameter can include a default value and a description.name (string) –
The name of the query parameter. A query parameter name must start with a letter or underscore, and contain only letters, digits, and underscores.
defaultValue (string) –
The default value to use for this query parameter if no value is supplied at execution time.
description (string) –
A description of the query parameter that explains its purpose or expected values.
nextToken (string) –
The token for the next set of items to return. The token expires after 24 hours.
Exceptions