Interface ILogQueryWidgetProps
Properties for a Query widget.
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ILogQueryWidgetProps
Syntax (vb)
Public Interface ILogQueryWidgetProps
Remarks
ExampleMetadata: infused
Examples
Dashboard dashboard;
dashboard.AddWidgets(new LogQueryWidget(new LogQueryWidgetProps {
LogGroupNames = new [] { "my-log-group" },
View = LogQueryVisualizationType.TABLE,
// The lines will be automatically combined using '\n|'.
QueryLines = new [] { "fields @message", "filter @message like /Error/" }
}));
Synopsis
Properties
| AccountId | The AWS account ID where the log groups are located. |
| Height | Height of the widget. |
| LogGroupNames | Names of log groups to query. |
| QueryLanguage | The query language to use for the query. |
| QueryLines | A sequence of lines to use to build the query. |
| QueryString | Full query string for log insights. |
| Region | The region the metrics of this widget should be taken from. |
| Title | Title for the widget. |
| View | The type of view to use. |
| Width | Width of the widget, in a grid of 24 units wide. |
Properties
AccountId
The AWS account ID where the log groups are located.
string? AccountId { get; }
Property Value
Remarks
This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account.
For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html
Default: - Current account
Height
LogGroupNames
Names of log groups to query.
string[] LogGroupNames { get; }
Property Value
string[]
Remarks
ExampleMetadata: infused
QueryLanguage
The query language to use for the query.
LogQueryLanguage? QueryLanguage { get; }
Property Value
Remarks
Default: LogQueryLanguage.LOGS_INSIGHTS
QueryLines
A sequence of lines to use to build the query.
string[]? QueryLines { get; }
Property Value
string[]
Remarks
The query will be built by joining the lines together using \n|.
Default: - Exactly one of queryString, queryLines is required.
QueryString
Full query string for log insights.
string? QueryString { get; }
Property Value
Remarks
Be sure to prepend every new line with a newline and pipe character
(\n|).
Default: - Exactly one of queryString, queryLines is required.
Region
The region the metrics of this widget should be taken from.
string? Region { get; }
Property Value
Remarks
Default: Current region
Title
View
The type of view to use.
LogQueryVisualizationType? View { get; }
Property Value
Remarks
Default: LogQueryVisualizationType.TABLE
Width
Width of the widget, in a grid of 24 units wide.
double? Width { get; }
Property Value
Remarks
Default: 6