class LogQueryWidget
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CloudWatch.LogQueryWidget |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awscloudwatch#LogQueryWidget |
![]() | software.amazon.awscdk.services.cloudwatch.LogQueryWidget |
![]() | aws_cdk.aws_cloudwatch.LogQueryWidget |
![]() | aws-cdk-lib » aws_cloudwatch » LogQueryWidget |
Implements
IWidget
Extends
Concrete
Display query results from Logs Insights.
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/',
]
}));
Initializer
new LogQueryWidget(props: LogQueryWidgetProps)
Parameters
- props
Log
Query Widget Props
Properties
Name | Type | Description |
---|---|---|
height | number | The amount of vertical grid units the widget will take up. |
width | number | The amount of horizontal grid units the widget will take up. |
warnings? | string[] | Any warnings that are produced as a result of putting together this widget. |
warnings | { [string]: string } | Any warnings that are produced as a result of putting together this widget. |
height
Type:
number
The amount of vertical grid units the widget will take up.
width
Type:
number
The amount of horizontal grid units the widget will take up.
warnings?
Type:
string[]
(optional)
Any warnings that are produced as a result of putting together this widget.
warningsV2?
Type:
{ [string]: string }
(optional)
Any warnings that are produced as a result of putting together this widget.
Methods
Name | Description |
---|---|
position(x, y) | Place the widget at a given position. |
to | Return the widget JSON for use in the dashboard. |
position(x, y)
public position(x: number, y: number): void
Parameters
- x
number
- y
number
Place the widget at a given position.
toJson()
public toJson(): any[]
Returns
any[]
Return the widget JSON for use in the dashboard.