LogQueryWidgetProps Struct
Properties for a Query widget.
Example
ts
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
The AWS account ID where the log groups are located.
notes
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
Height of the widget.
logGroupNamesstring[]log_group_namestyping.List[str]logGroupNamesList<String>LogGroupNamesstring[]LogGroupNames*[]*stringrequired#Names of log groups to query.
queryLanguageLogQueryLanguagequery_languageLogQueryLanguagequeryLanguageLogQueryLanguageQueryLanguageLogQueryLanguageQueryLanguageLogQueryLanguage= LogQueryLanguage.LOGS_INSIGHTS#The query language to use for the query.
queryLinesstring[]query_linestyping.List[str]queryLinesList<String>QueryLinesstring[]QueryLines*[]*string= Exactly one of `queryString`, `q…#A sequence of lines to use to build the query.
The query will be built by joining the lines together using \n|.
default
Default: Exactly one of queryString, queryLines is required.
queryStringstringquery_stringstrqueryStringStringQueryStringstringQueryString*string= Exactly one of `queryString`, `q…#Full query string for log insights.
Be sure to prepend every new line with a newline and pipe character (\n|).
default
Default: Exactly one of queryString, queryLines is required.
The region the metrics of this widget should be taken from.
Title for the widget.
viewLogQueryVisualizationTypeviewLogQueryVisualizationTypeviewLogQueryVisualizationTypeViewLogQueryVisualizationTypeViewLogQueryVisualizationType= LogQueryVisualizationType.TABLE#The type of view to use.
Width of the widget, in a grid of 24 units wide.