aws-cdk-lib.aws_cloudwatch.LogQueryWidgetProps

interface LogQueryWidgetProps

LanguageType name
.NETAmazon.CDK.AWS.CloudWatch.LogQueryWidgetProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#LogQueryWidgetProps
Javasoftware.amazon.awscdk.services.cloudwatch.LogQueryWidgetProps
Pythonaws_cdk.aws_cloudwatch.LogQueryWidgetProps
TypeScript (source)aws-cdk-lib » aws_cloudwatch » LogQueryWidgetProps

Properties for a Query widget.

Example

declare const dashboard: cloudwatch.Dashboard;

dashboard.addWidgets(new cloudwatch.LogQueryWidget({
  logGroupNames: ['my-log-group'],
  view: cloudwatch.LogQueryVisualizationType.TABLE,
  // The lines will be automatically combined using '\n|'.
  queryLines: [
    'fields @message',
    'filter @message like /Error/',
  ]
}));

Properties

NameTypeDescription
logGroupNamesstring[]Names of log groups to query.
height?numberHeight of the widget.
queryLines?string[]A sequence of lines to use to build the query.
queryString?stringFull query string for log insights.
region?stringThe region the metrics of this widget should be taken from.
title?stringTitle for the widget.
view?LogQueryVisualizationTypeThe type of view to use.
width?numberWidth of the widget, in a grid of 24 units wide.

logGroupNames

Type: string[]

Names of log groups to query.


height?

Type: number (optional, default: 6)

Height of the widget.


queryLines?

Type: string[] (optional, default: Exactly one of queryString, queryLines is required.)

A sequence of lines to use to build the query.

The query will be built by joining the lines together using \n|.


queryString?

Type: string (optional, default: Exactly one of queryString, queryLines is required.)

Full query string for log insights.

Be sure to prepend every new line with a newline and pipe character (\n|).


region?

Type: string (optional, default: Current region)

The region the metrics of this widget should be taken from.


title?

Type: string (optional, default: No title)

Title for the widget.


view?

Type: LogQueryVisualizationType (optional, default: LogQueryVisualizationType.TABLE)

The type of view to use.


width?

Type: number (optional, default: 6)

Width of the widget, in a grid of 24 units wide.