@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:42.007Z") 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
Specifies the CloudWatch metric dimensions to publish with this metric.
|
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.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnMetricFilter(Construct scope,
java.lang.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 java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getFilterName()
The name of the metric filter.
|
java.lang.String |
getFilterPattern()
A filter pattern for extracting metric data out of ingested log events.
|
java.lang.String |
getLogGroupName()
The name of an existing log group that you want to associate with this metric filter.
|
java.lang.Object |
getMetricTransformations()
The metric transformations.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setFilterName(java.lang.String value)
The name of the metric filter.
|
void |
setFilterPattern(java.lang.String value)
A filter pattern for extracting metric data out of ingested log events.
|
void |
setLogGroupName(java.lang.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(java.util.List<java.lang.Object> value)
The metric transformations.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnMetricFilter(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnMetricFilter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnMetricFilter(Construct scope, java.lang.String id, 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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.String getFilterPattern()
For more information, see Filter and Pattern Syntax .
public void setFilterPattern(java.lang.String value)
For more information, see Filter and Pattern Syntax .
public java.lang.String getLogGroupName()
public void setLogGroupName(java.lang.String value)
public java.lang.Object getMetricTransformations()
public void setMetricTransformations(IResolvable value)
public void setMetricTransformations(java.util.List<java.lang.Object> value)
public java.lang.String getFilterName()
public void setFilterName(java.lang.String value)