1. Packages
  2. AWS Native
  3. API Docs
  4. logs
  5. getMetricFilter

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws-native.logs.getMetricFilter

Explore with Pulumi AI

aws-native logo

AWS Native is in preview. AWS Classic is fully supported.

AWS Native v0.109.0 published on Wednesday, Jun 26, 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.

    Using getMetricFilter

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getMetricFilter(args: GetMetricFilterArgs, opts?: InvokeOptions): Promise<GetMetricFilterResult>
    function getMetricFilterOutput(args: GetMetricFilterOutputArgs, opts?: InvokeOptions): Output<GetMetricFilterResult>
    def get_metric_filter(filter_name: Optional[str] = None,
                          log_group_name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetMetricFilterResult
    def get_metric_filter_output(filter_name: Optional[pulumi.Input[str]] = None,
                          log_group_name: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetMetricFilterResult]
    func LookupMetricFilter(ctx *Context, args *LookupMetricFilterArgs, opts ...InvokeOption) (*LookupMetricFilterResult, error)
    func LookupMetricFilterOutput(ctx *Context, args *LookupMetricFilterOutputArgs, opts ...InvokeOption) LookupMetricFilterResultOutput

    > Note: This function is named LookupMetricFilter in the Go SDK.

    public static class GetMetricFilter 
    {
        public static Task<GetMetricFilterResult> InvokeAsync(GetMetricFilterArgs args, InvokeOptions? opts = null)
        public static Output<GetMetricFilterResult> Invoke(GetMetricFilterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMetricFilterResult> getMetricFilter(GetMetricFilterArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws-native:logs:getMetricFilter
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FilterName string
    The name of the metric filter.
    LogGroupName string
    The name of an existing log group that you want to associate with this metric filter.
    FilterName string
    The name of the metric filter.
    LogGroupName string
    The name of an existing log group that you want to associate with this metric filter.
    filterName String
    The name of the metric filter.
    logGroupName String
    The name of an existing log group that you want to associate with this metric filter.
    filterName string
    The name of the metric filter.
    logGroupName string
    The name of an existing log group that you want to associate with this metric filter.
    filter_name str
    The name of the metric filter.
    log_group_name str
    The name of an existing log group that you want to associate with this metric filter.
    filterName String
    The name of the metric filter.
    logGroupName String
    The name of an existing log group that you want to associate with this metric filter.

    getMetricFilter Result

    The following output properties are available:

    FilterPattern string
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    MetricTransformations List<Pulumi.AwsNative.Logs.Outputs.MetricFilterMetricTransformation>
    The metric transformations.
    FilterPattern string
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    MetricTransformations []MetricFilterMetricTransformation
    The metric transformations.
    filterPattern String
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    metricTransformations List<MetricFilterMetricTransformation>
    The metric transformations.
    filterPattern string
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    metricTransformations MetricFilterMetricTransformation[]
    The metric transformations.
    filter_pattern str
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    metric_transformations Sequence[MetricFilterMetricTransformation]
    The metric transformations.
    filterPattern String
    A filter pattern for extracting metric data out of ingested log events. For more information, see Filter and Pattern Syntax.
    metricTransformations List<Property Map>
    The metric transformations.

    Supporting Types

    MetricFilterDimension

    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

    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

    Package Details

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

    AWS Native is in preview. AWS Classic is fully supported.

    AWS Native v0.109.0 published on Wednesday, Jun 26, 2024 by Pulumi