@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.699Z") @Stability(value=Stable) public class CfnMetricFilter extends CfnResource implements IInspectable
The AWS::Logs::MetricFilter resource specifies a metric filter that describes how CloudWatch Logs extracts information from logs and transforms it into Amazon CloudWatch metrics. If you have multiple metric filters that are associated with a log group, all the filters are applied to the log streams in that group.
The maximum number of metric filters that can be associated with a log group is 100.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.logs.*;
CfnMetricFilter cfnMetricFilter = CfnMetricFilter.Builder.create(this, "MyCfnMetricFilter")
.filterPattern("filterPattern")
.logGroupName("logGroupName")
.metricTransformations(List.of(MetricTransformationProperty.builder()
.metricName("metricName")
.metricNamespace("metricNamespace")
.metricValue("metricValue")
// the properties below are optional
.defaultValue(123)
.dimensions(List.of(DimensionProperty.builder()
.key("key")
.value("value")
.build()))
.unit("unit")
.build()))
// the properties below are optional
.filterName("filterName")
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnMetricFilter.Builder
A fluent builder for
CfnMetricFilter. |
static interface |
CfnMetricFilter.DimensionProperty
Example:
|
static interface |
CfnMetricFilter.MetricTransformationProperty
`MetricTransformation` is a property of the `AWS::Logs::MetricFilter` resource that describes how to transform log streams into a CloudWatch metric.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnMetricFilter(software.constructs.Construct scope,
String id,
CfnMetricFilterProps props)
Create a new `AWS::Logs::MetricFilter`.
|
protected |
CfnMetricFilter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnMetricFilter(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
getCfnProperties() |
String |
getFilterName()
`AWS::Logs::MetricFilter.FilterName`.
|
String |
getFilterPattern()
A filter pattern for extracting metric data out of ingested log events.
|
String |
getLogGroupName()
The name of an existing log group that you want to associate with this metric filter.
|
Object |
getMetricTransformations()
The metric transformations.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setFilterName(String value)
`AWS::Logs::MetricFilter.FilterName`.
|
void |
setFilterPattern(String value)
A filter pattern for extracting metric data out of ingested log events.
|
void |
setLogGroupName(String value)
The name of an existing log group that you want to associate with this metric filter.
|
void |
setMetricTransformations(IResolvable value)
The metric transformations.
|
void |
setMetricTransformations(List<Object> value)
The metric transformations.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnMetricFilter(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnMetricFilter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnMetricFilter(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnMetricFilterProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getFilterPattern()
For more information, see Filter and Pattern Syntax .
@Stability(value=Stable)
public void setFilterPattern(@NotNull
String value)
For more information, see Filter and Pattern Syntax .
@Stability(value=Stable) @NotNull public String getLogGroupName()
@Stability(value=Stable)
public void setLogGroupName(@NotNull
String value)
@Stability(value=Stable) @NotNull public Object getMetricTransformations()
@Stability(value=Stable)
public void setMetricTransformations(@NotNull
IResolvable value)
@Stability(value=Stable)
public void setMetricTransformations(@NotNull
List<Object> value)
@Stability(value=Stable) @Nullable public String getFilterName()
@Stability(value=Stable)
public void setFilterName(@Nullable
String value)
Copyright © 2022. All rights reserved.