interface CfnMetricFilterProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Logs.CfnMetricFilterProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#CfnMetricFilterProps |
Java | software.amazon.awscdk.services.logs.CfnMetricFilterProps |
Python | aws_cdk.aws_logs.CfnMetricFilterProps |
TypeScript | aws-cdk-lib » aws_logs » CfnMetricFilterProps |
Properties for defining a CfnMetricFilter.
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-metricfilter.html
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
applyOnTransformedLogs: false,
emitSystemFieldDimensions: ['emitSystemFieldDimensions'],
fieldSelectionCriteria: 'fieldSelectionCriteria',
filterName: 'filterName',
};
Properties
| Name | Type | Description |
|---|---|---|
| filter | string | A filter pattern for extracting metric data out of ingested log events. |
| log | string | ILog | The name of an existing log group that you want to associate with this metric filter. |
| metric | IResolvable | (IResolvable | Metric)[] | The metric transformations. |
| apply | boolean | IResolvable | This parameter is valid only for log groups that have an active log transformer. |
| emit | string[] | The list of system fields that are emitted as additional dimensions in the generated metrics. |
| field | string | The filter expression that specifies which log events are processed by this metric filter based on system fields. |
| filter | string | The 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 | ILog
The name of an existing log group that you want to associate with this metric filter.
metricTransformations
Type:
IResolvable | (IResolvable | Metric)[]
The metric transformations.
applyOnTransformedLogs?
Type:
boolean | IResolvable
(optional)
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.
emitSystemFieldDimensions?
Type:
string[]
(optional)
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.
fieldSelectionCriteria?
Type:
string
(optional)
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.
filterName?
Type:
string
(optional)
The name of the metric filter.

.NET
Go
Java
Python
TypeScript