CfnMetricFilterProps

class aws_cdk.aws_logs.CfnMetricFilterProps(*, filter_pattern, log_group_name, metric_transformations, filter_name=None)

Bases: object

Properties for defining a CfnMetricFilter.

Parameters:
  • filter_pattern (str) – A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax .

  • log_group_name (str) – The name of an existing log group that you want to associate with this metric filter.

  • metric_transformations (Union[IResolvable, Sequence[Union[IResolvable, MetricTransformationProperty, Dict[str, Any]]]]) – The metric transformations.

  • filter_name (Optional[str]) – The name of the metric filter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_logs as logs

cfn_metric_filter_props = logs.CfnMetricFilterProps(
    filter_pattern="filterPattern",
    log_group_name="logGroupName",
    metric_transformations=[logs.CfnMetricFilter.MetricTransformationProperty(
        metric_name="metricName",
        metric_namespace="metricNamespace",
        metric_value="metricValue",

        # the properties below are optional
        default_value=123,
        dimensions=[logs.CfnMetricFilter.DimensionProperty(
            key="key",
            value="value"
        )],
        unit="unit"
    )],

    # the properties below are optional
    filter_name="filterName"
)

Attributes

filter_name

The name of the metric filter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-filtername

filter_pattern

A filter pattern for extracting metric data out of ingested log events.

For more information, see Filter and Pattern Syntax .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-filterpattern

log_group_name

The name of an existing log group that you want to associate with this metric filter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-loggroupname

metric_transformations

The metric transformations.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html#cfn-logs-metricfilter-metrictransformations