CfnMetricFilterProps

class aws_cdk.aws_logs.CfnMetricFilterProps(*, filter_pattern, log_group_name, metric_transformations, apply_on_transformed_logs=None, emit_system_field_dimensions=None, field_selection_criteria=None, 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.

  • apply_on_transformed_logs (Union[bool, IResolvable, None]) – This parameter is valid only for log groups that have an active log transformer. For more information about log transformers, see PutTransformer . If this value is true , the metric filter is applied on the transformed version of the log events instead of the original ingested log events.

  • emit_system_field_dimensions (Optional[Sequence[str]]) – The list of system fields that are emitted as additional dimensions in the generated metrics. Returns the emitSystemFieldDimensions value if it was specified when the metric filter was created.

  • field_selection_criteria (Optional[str]) – The filter expression that specifies which log events are processed by this metric filter based on system fields. Returns the fieldSelectionCriteria value if it was specified when the metric filter was created.

  • 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
    apply_on_transformed_logs=False,
    emit_system_field_dimensions=["emitSystemFieldDimensions"],
    field_selection_criteria="fieldSelectionCriteria",
    filter_name="filterName"
)

Attributes

apply_on_transformed_logs

This parameter is valid only for log groups that have an active log transformer.

For more information about log transformers, see PutTransformer .

If this value is true , the metric filter is applied on the transformed version of the log events instead of the original ingested log events.

See:

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

emit_system_field_dimensions

The list of system fields that are emitted as additional dimensions in the generated metrics.

Returns the emitSystemFieldDimensions value if it was specified when the metric filter was created.

See:

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

field_selection_criteria

The filter expression that specifies which log events are processed by this metric filter based on system fields.

Returns the fieldSelectionCriteria value if it was specified when the metric filter was created.

See:

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

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