{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-logs-metricfilter.json",
  "title": "AWSLogsMetricFilterProperties",
  "description": "Specifies a metric filter that describes how CloudWatch Logs extracts information from logs and transforms it into Amazon CloudWatch metrics.. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs.git>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-logs-metricfilter.json",
    "sourceSha256": "d898177caaf78c53805cee837eb9eeea95692258e1686aed110ed5eaf63d4fd4"
  },
  "type": "object",
  "properties": {
    "FilterName": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^:*]{1,512}"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "A name for the metric filter."
    },
    "FilterPattern": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 1024
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Pattern that Logs follows to interpret each entry in a log."
    },
    "LogGroupName": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[.\\-_/#A-Za-z0-9]{1,512}"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "Existing log group that you want to associate with this filter."
    },
    "MetricTransformations": {
      "description": "A collection of information that defines how metric data gets emitted.",
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "insertionOrder": false,
      "items": {
        "$ref": "#/$defs/MetricTransformation"
      }
    }
  },
  "typeName": "AWS::Logs::MetricFilter",
  "resourceLink": {
    "templateUri": "/cloudwatch/home?region=${awsRegion}#logsV2:log-groups/log-group/${LogGroupName}/edit-metric-filter/${MetricName}",
    "mappings": {
      "MetricName": "/MetricName",
      "LogGroupName": "/LogGroupName"
    }
  },
  "$defs": {
    "Dimension": {
      "description": "the key-value pairs that further define a metric.",
      "type": "object",
      "title": "AWSLogsMetricFilterDimensionDefinition",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The key of the dimension. Maximum length of 255."
        },
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The value of the dimension. Maximum length of 255."
        }
      },
      "required": [
        "Key",
        "Value"
      ],
      "additionalProperties": false
    },
    "MetricTransformation": {
      "type": "object",
      "properties": {
        "DefaultValue": {
          "description": "The value to emit when a filter pattern does not match a log event. This value can be null.",
          "type": "number"
        },
        "MetricName": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^((?![:*$])[\\x00-\\x7F]){1,255}"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The name of the CloudWatch metric. Metric name must be in ASCII format."
        },
        "MetricNamespace": {
          "oneOf": [
            {
              "$comment": "Namespaces can be up to 256 characters long; valid characters include 0-9A-Za-z.-_/#",
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[0-9a-zA-Z\\.\\-_\\/#]{1,256}"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The namespace of the CloudWatch metric."
        },
        "MetricValue": {
          "oneOf": [
            {
              "type": "string",
              "pattern": ".{1,100}",
              "minLength": 1,
              "maxLength": 100
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The value to publish to the CloudWatch metric when a filter pattern matches a log event."
        },
        "Unit": {
          "oneOf": [
            {
              "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"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ],
          "description": "The unit to assign to the metric. If you omit this, the unit is set as None."
        },
        "Dimensions": {
          "description": "Dimensions are the key-value pairs that further define a metric",
          "type": "array",
          "uniqueItems": true,
          "insertionOrder": false,
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "$ref": "#/$defs/Dimension"
          }
        }
      },
      "required": [
        "MetricName",
        "MetricNamespace",
        "MetricValue"
      ],
      "title": "AWSLogsMetricFilterMetricTransformationDefinition",
      "additionalProperties": false
    }
  },
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs.git",
  "tagging": {
    "taggable": false
  },
  "replacementStrategy": "delete_then_create",
  "additionalProperties": false,
  "primaryIdentifier": [
    "/properties/LogGroupName",
    "/properties/FilterName"
  ],
  "required": [
    "FilterPattern",
    "LogGroupName",
    "MetricTransformations"
  ],
  "createOnlyProperties": [
    "/properties/FilterName",
    "/properties/LogGroupName"
  ]
}
