aws-cdk-lib.aws_logs.CfnMetricFilterProps

interface CfnMetricFilterProps

LanguageType name
.NETAmazon.CDK.AWS.Logs.CfnMetricFilterProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslogs#CfnMetricFilterProps
Javasoftware.amazon.awscdk.services.logs.CfnMetricFilterProps
Pythonaws_cdk.aws_logs.CfnMetricFilterProps
TypeScript aws-cdk-lib » aws_logs » CfnMetricFilterProps

Properties for defining a CfnMetricFilter.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_logs as logs } from 'aws-cdk-lib';
const cfnMetricFilterProps: logs.CfnMetricFilterProps = {
  filterPattern: 'filterPattern',
  logGroupName: 'logGroupName',
  metricTransformations: [{
    metricName: 'metricName',
    metricNamespace: 'metricNamespace',
    metricValue: 'metricValue',

    // the properties below are optional
    defaultValue: 123,
    dimensions: [{
      key: 'key',
      value: 'value',
    }],
    unit: 'unit',
  }],

  // the properties below are optional
  filterName: 'filterName',
};

Properties

NameTypeDescription
filterPatternstringA filter pattern for extracting metric data out of ingested log events.
logGroupNamestringThe name of an existing log group that you want to associate with this metric filter.
metricTransformationsIResolvable | IResolvable | MetricTransformationProperty[]The metric transformations.
filterName?stringThe name of the metric filter.

filterPattern

Type: string

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

For more information, see Filter and Pattern Syntax .


logGroupName

Type: string

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


metricTransformations

Type: IResolvable | IResolvable | MetricTransformationProperty[]

The metric transformations.


filterName?

Type: string (optional)

The name of the metric filter.