1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. logs
  5. MetricFilter

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.7.0 published on Monday, Nov 11, 2024 by Pulumi

aws-native.logs.MetricFilter

Explore with Pulumi AI

aws-native logo

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.7.0 published on Monday, Nov 11, 2024 by Pulumi

    The AWS::Logs::MetricFilter resource specifies a metric filter that describes how CWL 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.

    Create MetricFilter Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MetricFilter(name: string, args: MetricFilterArgs, opts?: CustomResourceOptions);
    @overload
    def MetricFilter(resource_name: str,
                     args: MetricFilterArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def MetricFilter(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     filter_pattern: Optional[str] = None,
                     log_group_name: Optional[str] = None,
                     metric_transformations: Optional[Sequence[MetricFilterMetricTransformationArgs]] = None,
                     filter_name: Optional[str] = None)
    func NewMetricFilter(ctx *Context, name string, args MetricFilterArgs, opts ...ResourceOption) (*MetricFilter, error)
    public MetricFilter(string name, MetricFilterArgs args, CustomResourceOptions? opts = null)
    public MetricFilter(String name, MetricFilterArgs args)
    public MetricFilter(String name, MetricFilterArgs args, CustomResourceOptions options)
    
    type: aws-native:logs:MetricFilter
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MetricFilterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MetricFilterArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MetricFilterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MetricFilterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MetricFilterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    MetricFilter Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The MetricFilter resource accepts the following input properties:

    FilterPattern string
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    LogGroupName string
    The name of an existing log group that you want to associate with this metric filter.
    MetricTransformations List<Pulumi.AwsNative.Logs.Inputs.MetricFilterMetricTransformation>
    The metric transformations.
    FilterName string
    The name of the metric filter.
    FilterPattern string
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    LogGroupName string
    The name of an existing log group that you want to associate with this metric filter.
    MetricTransformations []MetricFilterMetricTransformationArgs
    The metric transformations.
    FilterName string
    The name of the metric filter.
    filterPattern String
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    logGroupName String
    The name of an existing log group that you want to associate with this metric filter.
    metricTransformations List<MetricFilterMetricTransformation>
    The metric transformations.
    filterName String
    The name of the metric filter.
    filterPattern string
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    logGroupName string
    The name of an existing log group that you want to associate with this metric filter.
    metricTransformations MetricFilterMetricTransformation[]
    The metric transformations.
    filterName string
    The name of the metric filter.
    filter_pattern str
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    log_group_name str
    The name of an existing log group that you want to associate with this metric filter.
    metric_transformations Sequence[MetricFilterMetricTransformationArgs]
    The metric transformations.
    filter_name str
    The name of the metric filter.
    filterPattern String
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    logGroupName String
    The name of an existing log group that you want to associate with this metric filter.
    metricTransformations List<Property Map>
    The metric transformations.
    filterName String
    The name of the metric filter.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MetricFilter resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Supporting Types

    MetricFilterDimension, MetricFilterDimensionArgs

    Key string
    The name for the CW metric dimension that the metric filter creates. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:).
    Value string
    The log event field that will contain the value for this dimension. This dimension will only be published for a metric if the value is found in the log event. For example, $.eventType for JSON log events, or $server for space-delimited log events.
    Key string
    The name for the CW metric dimension that the metric filter creates. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:).
    Value string
    The log event field that will contain the value for this dimension. This dimension will only be published for a metric if the value is found in the log event. For example, $.eventType for JSON log events, or $server for space-delimited log events.
    key String
    The name for the CW metric dimension that the metric filter creates. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:).
    value String
    The log event field that will contain the value for this dimension. This dimension will only be published for a metric if the value is found in the log event. For example, $.eventType for JSON log events, or $server for space-delimited log events.
    key string
    The name for the CW metric dimension that the metric filter creates. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:).
    value string
    The log event field that will contain the value for this dimension. This dimension will only be published for a metric if the value is found in the log event. For example, $.eventType for JSON log events, or $server for space-delimited log events.
    key str
    The name for the CW metric dimension that the metric filter creates. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:).
    value str
    The log event field that will contain the value for this dimension. This dimension will only be published for a metric if the value is found in the log event. For example, $.eventType for JSON log events, or $server for space-delimited log events.
    key String
    The name for the CW metric dimension that the metric filter creates. Dimension names must contain only ASCII characters, must include at least one non-whitespace character, and cannot start with a colon (:).
    value String
    The log event field that will contain the value for this dimension. This dimension will only be published for a metric if the value is found in the log event. For example, $.eventType for JSON log events, or $server for space-delimited log events.

    MetricFilterMetricTransformation, MetricFilterMetricTransformationArgs

    MetricName string
    The name of the CloudWatch metric.
    MetricNamespace string
    A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see Namespaces.
    MetricValue string
    The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a particular term like Error, specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of the field that you specified in the filter pattern, such as $.size.
    DefaultValue double
    (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
    Dimensions List<Pulumi.AwsNative.Logs.Inputs.MetricFilterDimension>
    The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Charges.
    Unit Pulumi.AwsNative.Logs.MetricFilterMetricTransformationUnit
    The unit to assign to the metric. If you omit this, the unit is set as None.
    MetricName string
    The name of the CloudWatch metric.
    MetricNamespace string
    A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see Namespaces.
    MetricValue string
    The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a particular term like Error, specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of the field that you specified in the filter pattern, such as $.size.
    DefaultValue float64
    (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
    Dimensions []MetricFilterDimension
    The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Charges.
    Unit MetricFilterMetricTransformationUnit
    The unit to assign to the metric. If you omit this, the unit is set as None.
    metricName String
    The name of the CloudWatch metric.
    metricNamespace String
    A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see Namespaces.
    metricValue String
    The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a particular term like Error, specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of the field that you specified in the filter pattern, such as $.size.
    defaultValue Double
    (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
    dimensions List<MetricFilterDimension>
    The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Charges.
    unit MetricFilterMetricTransformationUnit
    The unit to assign to the metric. If you omit this, the unit is set as None.
    metricName string
    The name of the CloudWatch metric.
    metricNamespace string
    A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see Namespaces.
    metricValue string
    The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a particular term like Error, specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of the field that you specified in the filter pattern, such as $.size.
    defaultValue number
    (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
    dimensions MetricFilterDimension[]
    The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Charges.
    unit MetricFilterMetricTransformationUnit
    The unit to assign to the metric. If you omit this, the unit is set as None.
    metric_name str
    The name of the CloudWatch metric.
    metric_namespace str
    A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see Namespaces.
    metric_value str
    The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a particular term like Error, specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of the field that you specified in the filter pattern, such as $.size.
    default_value float
    (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
    dimensions Sequence[MetricFilterDimension]
    The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Charges.
    unit MetricFilterMetricTransformationUnit
    The unit to assign to the metric. If you omit this, the unit is set as None.
    metricName String
    The name of the CloudWatch metric.
    metricNamespace String
    A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see Namespaces.
    metricValue String
    The value that is published to the CloudWatch metric. For example, if you're counting the occurrences of a particular term like Error, specify 1 for the metric value. If you're counting the number of bytes transferred, reference the value that is in the log event by using $. followed by the name of the field that you specified in the filter pattern, such as $.size.
    defaultValue Number
    (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
    dimensions List<Property Map>
    The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as IPAddress or requestID as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric. CloudWatch Logs disables a metric filter if it generates 1000 different name/value pairs for your specified dimensions within a certain amount of time. This helps to prevent accidental high charges. You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Charges.
    unit "Seconds" | "Microseconds" | "Milliseconds" | "Bytes" | "Kilobytes" | "Megabytes" | "Gigabytes" | "Terabytes" | "Bits" | "Kilobits" | "Megabits" | "Gigabits" | "Terabits" | "Percent" | "Count" | "Bytes/Second" | "Kilobytes/Second" | "Megabytes/Second" | "Gigabytes/Second" | "Terabytes/Second" | "Bits/Second" | "Kilobits/Second" | "Megabits/Second" | "Gigabits/Second" | "Terabits/Second" | "Count/Second" | "None"
    The unit to assign to the metric. If you omit this, the unit is set as None.

    MetricFilterMetricTransformationUnit, MetricFilterMetricTransformationUnitArgs

    Seconds
    Seconds
    Microseconds
    Microseconds
    Milliseconds
    Milliseconds
    Bytes
    Bytes
    Kilobytes
    Kilobytes
    Megabytes
    Megabytes
    Gigabytes
    Gigabytes
    Terabytes
    Terabytes
    Bits
    Bits
    Kilobits
    Kilobits
    Megabits
    Megabits
    Gigabits
    Gigabits
    Terabits
    Terabits
    Percent
    Percent
    Count
    Count
    BytesSecond
    Bytes/Second
    KilobytesSecond
    Kilobytes/Second
    MegabytesSecond
    Megabytes/Second
    GigabytesSecond
    Gigabytes/Second
    TerabytesSecond
    Terabytes/Second
    BitsSecond
    Bits/Second
    KilobitsSecond
    Kilobits/Second
    MegabitsSecond
    Megabits/Second
    GigabitsSecond
    Gigabits/Second
    TerabitsSecond
    Terabits/Second
    CountSecond
    Count/Second
    None
    None
    MetricFilterMetricTransformationUnitSeconds
    Seconds
    MetricFilterMetricTransformationUnitMicroseconds
    Microseconds
    MetricFilterMetricTransformationUnitMilliseconds
    Milliseconds
    MetricFilterMetricTransformationUnitBytes
    Bytes
    MetricFilterMetricTransformationUnitKilobytes
    Kilobytes
    MetricFilterMetricTransformationUnitMegabytes
    Megabytes
    MetricFilterMetricTransformationUnitGigabytes
    Gigabytes
    MetricFilterMetricTransformationUnitTerabytes
    Terabytes
    MetricFilterMetricTransformationUnitBits
    Bits
    MetricFilterMetricTransformationUnitKilobits
    Kilobits
    MetricFilterMetricTransformationUnitMegabits
    Megabits
    MetricFilterMetricTransformationUnitGigabits
    Gigabits
    MetricFilterMetricTransformationUnitTerabits
    Terabits
    MetricFilterMetricTransformationUnitPercent
    Percent
    MetricFilterMetricTransformationUnitCount
    Count
    MetricFilterMetricTransformationUnitBytesSecond
    Bytes/Second
    MetricFilterMetricTransformationUnitKilobytesSecond
    Kilobytes/Second
    MetricFilterMetricTransformationUnitMegabytesSecond
    Megabytes/Second
    MetricFilterMetricTransformationUnitGigabytesSecond
    Gigabytes/Second
    MetricFilterMetricTransformationUnitTerabytesSecond
    Terabytes/Second
    MetricFilterMetricTransformationUnitBitsSecond
    Bits/Second
    MetricFilterMetricTransformationUnitKilobitsSecond
    Kilobits/Second
    MetricFilterMetricTransformationUnitMegabitsSecond
    Megabits/Second
    MetricFilterMetricTransformationUnitGigabitsSecond
    Gigabits/Second
    MetricFilterMetricTransformationUnitTerabitsSecond
    Terabits/Second
    MetricFilterMetricTransformationUnitCountSecond
    Count/Second
    MetricFilterMetricTransformationUnitNone
    None
    Seconds
    Seconds
    Microseconds
    Microseconds
    Milliseconds
    Milliseconds
    Bytes
    Bytes
    Kilobytes
    Kilobytes
    Megabytes
    Megabytes
    Gigabytes
    Gigabytes
    Terabytes
    Terabytes
    Bits
    Bits
    Kilobits
    Kilobits
    Megabits
    Megabits
    Gigabits
    Gigabits
    Terabits
    Terabits
    Percent
    Percent
    Count
    Count
    BytesSecond
    Bytes/Second
    KilobytesSecond
    Kilobytes/Second
    MegabytesSecond
    Megabytes/Second
    GigabytesSecond
    Gigabytes/Second
    TerabytesSecond
    Terabytes/Second
    BitsSecond
    Bits/Second
    KilobitsSecond
    Kilobits/Second
    MegabitsSecond
    Megabits/Second
    GigabitsSecond
    Gigabits/Second
    TerabitsSecond
    Terabits/Second
    CountSecond
    Count/Second
    None
    None
    Seconds
    Seconds
    Microseconds
    Microseconds
    Milliseconds
    Milliseconds
    Bytes
    Bytes
    Kilobytes
    Kilobytes
    Megabytes
    Megabytes
    Gigabytes
    Gigabytes
    Terabytes
    Terabytes
    Bits
    Bits
    Kilobits
    Kilobits
    Megabits
    Megabits
    Gigabits
    Gigabits
    Terabits
    Terabits
    Percent
    Percent
    Count
    Count
    BytesSecond
    Bytes/Second
    KilobytesSecond
    Kilobytes/Second
    MegabytesSecond
    Megabytes/Second
    GigabytesSecond
    Gigabytes/Second
    TerabytesSecond
    Terabytes/Second
    BitsSecond
    Bits/Second
    KilobitsSecond
    Kilobits/Second
    MegabitsSecond
    Megabits/Second
    GigabitsSecond
    Gigabits/Second
    TerabitsSecond
    Terabits/Second
    CountSecond
    Count/Second
    None
    None
    SECONDS
    Seconds
    MICROSECONDS
    Microseconds
    MILLISECONDS
    Milliseconds
    BYTES
    Bytes
    KILOBYTES
    Kilobytes
    MEGABYTES
    Megabytes
    GIGABYTES
    Gigabytes
    TERABYTES
    Terabytes
    BITS
    Bits
    KILOBITS
    Kilobits
    MEGABITS
    Megabits
    GIGABITS
    Gigabits
    TERABITS
    Terabits
    PERCENT
    Percent
    COUNT
    Count
    BYTES_SECOND
    Bytes/Second
    KILOBYTES_SECOND
    Kilobytes/Second
    MEGABYTES_SECOND
    Megabytes/Second
    GIGABYTES_SECOND
    Gigabytes/Second
    TERABYTES_SECOND
    Terabytes/Second
    BITS_SECOND
    Bits/Second
    KILOBITS_SECOND
    Kilobits/Second
    MEGABITS_SECOND
    Megabits/Second
    GIGABITS_SECOND
    Gigabits/Second
    TERABITS_SECOND
    Terabits/Second
    COUNT_SECOND
    Count/Second
    NONE
    None
    "Seconds"
    Seconds
    "Microseconds"
    Microseconds
    "Milliseconds"
    Milliseconds
    "Bytes"
    Bytes
    "Kilobytes"
    Kilobytes
    "Megabytes"
    Megabytes
    "Gigabytes"
    Gigabytes
    "Terabytes"
    Terabytes
    "Bits"
    Bits
    "Kilobits"
    Kilobits
    "Megabits"
    Megabits
    "Gigabits"
    Gigabits
    "Terabits"
    Terabits
    "Percent"
    Percent
    "Count"
    Count
    "Bytes/Second"
    Bytes/Second
    "Kilobytes/Second"
    Kilobytes/Second
    "Megabytes/Second"
    Megabytes/Second
    "Gigabytes/Second"
    Gigabytes/Second
    "Terabytes/Second"
    Terabytes/Second
    "Bits/Second"
    Bits/Second
    "Kilobits/Second"
    Kilobits/Second
    "Megabits/Second"
    Megabits/Second
    "Gigabits/Second"
    Gigabits/Second
    "Terabits/Second"
    Terabits/Second
    "Count/Second"
    Count/Second
    "None"
    None

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    We recommend new projects start with resources from the AWS provider.

    AWS Cloud Control v1.7.0 published on Monday, Nov 11, 2024 by Pulumi