AWS::Logs::QueryDefinitionCreates a query definition for CloudWatch Logs Insights. For more information, see [Analyzing Log Data with CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) .
import { CfnQueryDefinition } from 'aws-cdk-lib/aws-logs';Or use the module namespace:
import * as logs from 'aws-cdk-lib/aws-logs';
// logs.CfnQueryDefinitionConfiguration passed to the constructor as CfnQueryDefinitionProps.
nameRequiredstringA 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*` .
queryStringRequiredstringThe query string to use for this query definition. For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html) .
logGroupNamesOptionalstring | ILogGroupRef[]Use this parameter if you want the query to query only certain log groups.
parametersOptionalIResolvable | IResolvable | QueryParameterProperty[]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.
queryLanguageOptionalstringThe query language used for this query. For more information about the query languages that CloudWatch Logs supports, see [Supported query languages](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html) .
Default: - "CWLI"
This L1 construct maps directly to the following CloudFormation resource type.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-logsAWS::Logs::QueryDefinition