Class MetricFilterOptions
Properties for a MetricFilter created from a LogGroup.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.AWS.Logs.dll
Syntax (csharp)
public class MetricFilterOptions : Object, IMetricFilterOptions
Syntax (vb)
Public Class MetricFilterOptions
Inherits Object
Implements 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.Logs;
IFilterPattern filterPattern;
var metricFilterOptions = new MetricFilterOptions {
FilterPattern = filterPattern,
MetricName = "metricName",
MetricNamespace = "metricNamespace",
// the properties below are optional
DefaultValue = 123,
MetricValue = "metricValue"
};
Synopsis
Constructors
MetricFilterOptions() |
Properties
DefaultValue | The value to emit if the pattern does not match a particular event. |
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. |
Constructors
MetricFilterOptions()
public MetricFilterOptions()
Properties
DefaultValue
The value to emit if the pattern does not match a particular event.
public Nullable<double> DefaultValue { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: No metric emitted.
FilterPattern
Pattern to search for log events.
public IFilterPattern FilterPattern { get; set; }
Property Value
MetricName
The name of the metric to emit.
public string MetricName { get; set; }
Property Value
System.String
MetricNamespace
The namespace of the metric to emit.
public string MetricNamespace { get; set; }
Property Value
System.String
MetricValue
The value to emit for the metric.
public string MetricValue { get; set; }
Property Value
System.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"