interface CfnQueryDefinitionProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Logs.CfnQueryDefinitionProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#CfnQueryDefinitionProps |
Java | software.amazon.awscdk.services.logs.CfnQueryDefinitionProps |
Python | aws_cdk.aws_logs.CfnQueryDefinitionProps |
TypeScript | aws-cdk-lib » aws_logs » CfnQueryDefinitionProps |
Properties for defining a CfnQueryDefinition.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-querydefinition.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_logs as logs } from 'aws-cdk-lib';
const cfnQueryDefinitionProps: logs.CfnQueryDefinitionProps = {
name: 'name',
queryString: 'queryString',
// the properties below are optional
logGroupNames: ['logGroupNames'],
parameters: [{
name: 'name',
// the properties below are optional
defaultValue: 'defaultValue',
description: 'description',
}],
queryLanguage: 'queryLanguage',
};
Properties
| Name | Type | Description |
|---|---|---|
| name | string | A name for the query definition. |
| query | string | The query string to use for this query definition. |
| log | (string | ILog)[] | Use this parameter if you want the query to query only certain log groups. |
| parameters? | IResolvable | (IResolvable | Query)[] | Use this parameter to include specific query parameters as part of your query definition. |
| query | string | The query language used for this query. |
name
Type:
string
A name for the query definition.
You can use the name to create a folder structure for your queries. To create a folder, use a forward slash (/) to prefix your desired query name with your desired folder name. For example,
*folder-name* / *query-name*.
queryString
Type:
string
The query string to use for this query definition.
For more information, see CloudWatch Logs Insights Query Syntax .
logGroupNames?
Type:
(string | ILog)[]
(optional)
Use this parameter if you want the query to query only certain log groups.
parameters?
Type:
IResolvable | (IResolvable | Query)[]
(optional)
Use this parameter to include specific query parameters as part of your query definition.
Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the {{parameterName}} syntax in your query string to reference a parameter.
queryLanguage?
Type:
string
(optional, default: "CWLI")
The query language used for this query.
For more information about the query languages that CloudWatch Logs supports, see Supported query languages .

.NET
Go
Java
Python
TypeScript