Show / Hide Table of Contents

Interface IMetricFilterOptions

Properties for a MetricFilter created from a LogGroup.

Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IMetricFilterOptions
Syntax (vb)
Public Interface IMetricFilterOptions
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK.AWS.CloudWatch;
            using Amazon.CDK.AWS.Logs;

            IFilterPattern filterPattern;

            var metricFilterOptions = new MetricFilterOptions {
                FilterPattern = filterPattern,
                MetricName = "metricName",
                MetricNamespace = "metricNamespace",

                // the properties below are optional
                DefaultValue = 123,
                Dimensions = new Dictionary<string, string> {
                    { "dimensionsKey", "dimensions" }
                },
                FilterName = "filterName",
                MetricValue = "metricValue",
                Unit = Unit.SECONDS
            };

Synopsis

Properties

DefaultValue

The value to emit if the pattern does not match a particular event.

Dimensions

The fields to use as dimensions for the metric.

FilterName

The name of the metric filter.

FilterPattern

Pattern to search for log events.

MetricName

The name of the metric to emit.

MetricNamespace

The namespace of the metric to emit.

MetricValue

The value to emit for the metric.

Unit

The unit to assign to the metric.

Properties

DefaultValue

The value to emit if the pattern does not match a particular event.

double? DefaultValue { get; }
Property Value

double?

Remarks

Default: No metric emitted.

Dimensions

The fields to use as dimensions for the metric.

IDictionary<string, string>? Dimensions { get; }
Property Value

IDictionary<string, string>

Remarks

One metric filter can include as many as three dimensions.

Default: - No dimensions attached to metrics.

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-dimensions

FilterName

The name of the metric filter.

string? FilterName { get; }
Property Value

string

Remarks

Default: - Cloudformation generated name.

FilterPattern

Pattern to search for log events.

IFilterPattern FilterPattern { get; }
Property Value

IFilterPattern

Remarks

ExampleMetadata: fixture=_generated

MetricName

The name of the metric to emit.

string MetricName { get; }
Property Value

string

Remarks

ExampleMetadata: fixture=_generated

MetricNamespace

The namespace of the metric to emit.

string MetricNamespace { get; }
Property Value

string

Remarks

ExampleMetadata: fixture=_generated

MetricValue

The value to emit for the metric.

string? MetricValue { get; }
Property Value

string

Remarks

Can either be a literal number (typically "1"), or the name of a field in the structure to take the value from the matched event. If you are using a field value, the field value must have been matched using the pattern.

If you want to specify a field from a matched JSON structure, use '$.fieldName', and make sure the field is in the pattern (if only as '$.fieldName = *').

If you want to specify a field from a matched space-delimited structure, use '$fieldName'.

Default: "1"

Unit

The unit to assign to the metric.

Unit? Unit { get; }
Property Value

Unit?

Remarks

Default: - No unit attached to metrics.

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-logs-metricfilter-metrictransformation.html#cfn-logs-metricfilter-metrictransformation-unit

Back to top Generated by DocFX