LogQueryWidgetProps

class aws_cdk.aws_cloudwatch.LogQueryWidgetProps(*, log_group_names, height=None, query_lines=None, query_string=None, region=None, title=None, view=None, width=None)

Bases: object

Properties for a Query widget.

param log_group_names

Names of log groups to query.

param height

Height of the widget. Default: 6

param query_lines

A sequence of lines to use to build the query. The query will be built by joining the lines together using \n|. Default: - Exactly one of queryString, queryLines is required.

param query_string

Full query string for log insights. Be sure to prepend every new line with a newline and pipe character (\n|). Default: - Exactly one of queryString, queryLines is required.

param region

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

param title

Title for the widget. Default: No title

param view

The type of view to use. Default: LogQueryVisualizationType.TABLE

param width

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

Example:

# dashboard is of type Dashboard


dashboard.add_widgets(cloudwatch.LogQueryWidget(
    log_group_names=["my-log-group"],
    view=cloudwatch.LogQueryVisualizationType.TABLE,
    # The lines will be automatically combined using '
|’.

query_lines=[“fields @message”, “filter @message like /Error/” ]

))

Attributes

height

Height of the widget.

Default

6

Return type

Union[int, float, None]

log_group_names

Names of log groups to query.

Return type

List[str]

query_lines

A sequence of lines to use to build the query.

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

Default
  • Exactly one of queryString, queryLines is required.

Return type

Optional[List[str]]

query_string

Full query string for log insights.

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

Default
  • Exactly one of queryString, queryLines is required.

Return type

Optional[str]

region

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

Default

Current region

Return type

Optional[str]

title

Title for the widget.

Default

No title

Return type

Optional[str]

view

The type of view to use.

Default

LogQueryVisualizationType.TABLE

Return type

Optional[LogQueryVisualizationType]

width

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

Default

6

Return type

Union[int, float, None]