Amazon CloudWatch Cloudwatch Metric Filter API

The Cloudwatch Metric Filter API from Amazon CloudWatch — 4 operation(s) for cloudwatch metric filter.

GitHub OpenAPI

Operations 4

POST /#DeleteMetricFilter Delete Metric Filter #
POST /#DescribeMetricFilters Describe Metric Filters #
POST /#PutMetricFilter Put Metric Filter #
POST /#TestMetricFilter Test Metric Filter #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-cloudwatch:amazon-cloudwatch-metric-filter-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-cloudwatch-metric-filter-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amazon CloudWatch Metric Filter API
  version: '2010-08-01'
  description: Generated from AWS's published Smithy model for Amazon CloudWatch. 4 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://logs.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /#DeleteMetricFilter:
    post:
      operationId: DeleteMetricFilter
      summary: Delete Metric Filter
      description: Deletes the specified metric filter.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                type: string
        '400':
          description: InvalidParameterException; OperationAbortedException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidParameterException'
        '500':
          description: ServiceUnavailableException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Logs_20140328.DeleteMetricFilter
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DeleteMetricFilterRequest'
      tags:
      - Metric Filter
  /#DescribeMetricFilters:
    post:
      operationId: DescribeMetricFilters
      summary: Describe Metric Filters
      description: Lists the specified metric filters. You can list all of the metric filters or filter the results by log
        name, prefix, metric name, or metric namespace. The results are ASCII-sorted by filter name.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DescribeMetricFiltersResponse'
        '400':
          description: InvalidParameterException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidParameterException'
        '500':
          description: ServiceUnavailableException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Logs_20140328.DescribeMetricFilters
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/DescribeMetricFiltersRequest'
      tags:
      - Metric Filter
  /#PutMetricFilter:
    post:
      operationId: PutMetricFilter
      summary: Put Metric Filter
      description: Creates or updates a metric filter and associates it with the specified log group. With metric filters,
        you can configure rules to extract metric data from log events ingested through PutLogEvents. The maximum number of
        metric filters that can be associated with a log group is 100. Using regular expressions in filter patterns is supported.
        For these filters, there is a quota of two regular expression patterns within a single filter pattern. There is also
        a quota of five regular expression patterns per log group. For more information about using regular expressions in
        filter patterns, see Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail.
        When you create a metric filter, you can also optionally assign a unit and dimensions to the metric that is created.
        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 might disable a metric
        filter if it generates 1,000 different na
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                type: string
        '400':
          description: InvalidOperationException; InvalidParameterException; LimitExceededException; OperationAbortedException;
            ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidOperationException'
        '500':
          description: ServiceUnavailableException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Logs_20140328.PutMetricFilter
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/PutMetricFilterRequest'
      tags:
      - Metric Filter
  /#TestMetricFilter:
    post:
      operationId: TestMetricFilter
      summary: Test Metric Filter
      description: Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation
        to validate the correctness of a metric filter pattern.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/TestMetricFilterResponse'
        '400':
          description: InvalidParameterException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidParameterException'
        '500':
          description: ServiceUnavailableException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - Logs_20140328.TestMetricFilter
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/TestMetricFilterRequest'
      tags:
      - Metric Filter
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: logs
  schemas:
    DeleteMetricFilterRequest:
      type: object
      properties:
        logGroupName:
          type: string
          description: The name of the log group.
        filterName:
          type: string
          description: The name of the metric filter.
      required:
      - logGroupName
      - filterName
    DescribeMetricFiltersRequest:
      type: object
      properties:
        logGroupName:
          type: string
          description: The name of the log group.
        filterNamePrefix:
          type: string
          description: The prefix to match. CloudWatch Logs uses the value that you set here only if you also include the
            logGroupName parameter in your request.
        nextToken:
          type: string
          description: The token for the next set of items to return. (You received this token from a previous call.)
        limit:
          type: integer
          description: The maximum number of items returned. If you don't specify a value, the default is up to 50 items.
        metricName:
          type: string
          description: Filters results to include only those with the specified metric name. If you include this parameter
            in your request, you must also include the metricNamespace parameter.
        metricNamespace:
          type: string
          description: Filters results to include only those in the specified namespace. If you include this parameter in
            your request, you must also include the metricName parameter.
    DescribeMetricFiltersResponse:
      type: object
      properties:
        metricFilters:
          type: array
          items:
            $ref: '#/components/schemas/MetricFilter'
          description: The metric filters.
        nextToken:
          type: string
    InvalidOperationException:
      type: object
      properties:
        message:
          type: string
    InvalidParameterException:
      type: object
      properties:
        message:
          type: string
    MetricFilter:
      type: object
      properties:
        filterName:
          type: string
          description: The name of the metric filter.
        filterPattern:
          type: string
        metricTransformations:
          type: array
          items:
            $ref: '#/components/schemas/MetricTransformation'
          description: The metric transformations.
        creationTime:
          type: integer
          description: The creation time of the metric filter, expressed as the number of milliseconds after Jan 1, 1970 00:00:00
            UTC.
        logGroupName:
          type: string
          description: The name of the log group.
        applyOnTransformedLogs:
          type: boolean
          description: This parameter is valid only for log groups that have an active log transformer. For more information
            about log transformers, see PutTransformer. If this value is true, the metric filter is applied on the transformed
            version of the log events instead of the original ingested log events.
        fieldSelectionCriteria:
          type: string
          description: The filter expression that specifies which log events are processed by this metric filter based on
            system fields. Returns the fieldSelectionCriteria value if it was specified when the metric filter was created.
        emitSystemFieldDimensions:
          type: array
          items:
            type: string
          description: The list of system fields that are emitted as additional dimensions in the generated metrics. Returns
            the emitSystemFieldDimensions value if it was specified when the metric filter was created.
    MetricFilterMatchRecord:
      type: object
      properties:
        eventNumber:
          type: integer
          description: The event number.
        eventMessage:
          type: string
          description: The raw event data.
        extractedValues:
          type: object
          additionalProperties:
            type: string
          description: The values extracted from the event data by the filter.
    MetricTransformation:
      type: object
      properties:
        metricName:
          type: string
          description: The name of the CloudWatch metric.
        metricNamespace:
          type: string
          description: A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that
            are similar. For more information, see Namespaces.
        metricValue:
          type: string
          description: The value to publish to the CloudWatch metric when a filter pattern matches a log event.
        defaultValue:
          type: number
          description: (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.
        dimensions:
          type: object
          additionalProperties:
            type: string
          description: 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 accidenta
        unit:
          type: string
          enum:
          - 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
          description: The unit to assign to the metric. If you omit this, the unit is set as None.
      required:
      - metricName
      - metricNamespace
      - metricValue
    PutMetricFilterRequest:
      type: object
      properties:
        logGroupName:
          type: string
          description: The name of the log group.
        filterName:
          type: string
          description: A name for the metric filter.
        filterPattern:
          type: string
          description: A filter pattern for extracting metric data out of ingested log events.
        metricTransformations:
          type: array
          items:
            $ref: '#/components/schemas/MetricTransformation'
          description: A collection of information that defines how metric data gets emitted.
        applyOnTransformedLogs:
          type: boolean
          description: This parameter is valid only for log groups that have an active log transformer. For more information
            about log transformers, see PutTransformer. If the log group uses either a log-group level or account-level transformer,
            and you specify true, the metric filter will be applied on the transformed version of the log events instead of
            the original ingested log events.
        fieldSelectionCriteria:
          type: string
          description: 'A filter expression that specifies which log events should be processed by this metric filter based
            on system fields such as source account and source region. Uses selection criteria syntax with operators like
            =, !=, AND, OR, IN, NOT IN. Example: @aws.region = "us-east-1" or @aws.account IN ["123456789012", "987654321098"].
            Maximum length: 2000 characters.'
        emitSystemFieldDimensions:
          type: array
          items:
            type: string
          description: A list of system fields to emit as additional dimensions in the generated metrics. Valid values are
            @aws.account and @aws.region. These dimensions help identify the source of centralized log data and count toward
            the total dimension limit for metric filters.
      required:
      - logGroupName
      - filterName
      - filterPattern
      - metricTransformations
    ServiceUnavailableException:
      type: object
      properties:
        message:
          type: string
    TestMetricFilterRequest:
      type: object
      properties:
        filterPattern:
          type: string
        logEventMessages:
          type: array
          items:
            type: string
          description: The log event messages to test.
      required:
      - filterPattern
      - logEventMessages
    TestMetricFilterResponse:
      type: object
      properties:
        matches:
          type: array
          items:
            $ref: '#/components/schemas/MetricFilterMatchRecord'
          description: The matched events.
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/cloudwatch-logs/service/2014-03-28/cloudwatch-logs-2014-03-28.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)