CloudWatchLogs / Paginator / DescribeMetricFilters

DescribeMetricFilters#

class CloudWatchLogs.Paginator.DescribeMetricFilters#
paginator = client.get_paginator('describe_metric_filters')
paginate(**kwargs)#

Creates an iterator that will paginate through responses from CloudWatchLogs.Client.describe_metric_filters().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    logGroupName='string',
    filterNamePrefix='string',
    metricName='string',
    metricNamespace='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • logGroupName (string) – The name of the log group.

  • filterNamePrefix (string) – The prefix to match. CloudWatch Logs uses the value that you set here only if you also include the logGroupName parameter in your request.

  • metricName (string) – 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 (string) – 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.

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) –

      The size of each page.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:

dict

Returns:

Response Syntax

{
    'metricFilters': [
        {
            'filterName': 'string',
            'filterPattern': 'string',
            'metricTransformations': [
                {
                    'metricName': 'string',
                    'metricNamespace': 'string',
                    'metricValue': 'string',
                    'defaultValue': 123.0,
                    'dimensions': {
                        'string': 'string'
                    },
                    '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'
                },
            ],
            'creationTime': 123,
            'logGroupName': 'string',
            'applyOnTransformedLogs': True|False
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • metricFilters (list) –

      The metric filters.

      • (dict) –

        Metric filters express how CloudWatch Logs would extract metric observations from ingested log events and transform them into metric data in a CloudWatch metric.

        • filterName (string) –

          The name of the metric filter.

        • filterPattern (string) –

          A symbolic description of how CloudWatch Logs should interpret the data in each log event. For example, a log event can contain timestamps, IP addresses, strings, and so on. You use the filter pattern to specify what to look for in the log event message.

        • metricTransformations (list) –

          The metric transformations.

          • (dict) –

            Indicates how to transform ingested log events to metric data in a CloudWatch metric.

            • 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 to publish to the CloudWatch metric when a filter pattern matches a log event.

            • defaultValue (float) –

              (Optional) The value to emit when a filter pattern does not match a log event. This value can be null.

            • dimensions (dict) –

              The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions.

              Warning

              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 Amazon Web Services Charges.

              • (string) –

                • (string) –

            • unit (string) –

              The unit to assign to the metric. If you omit this, the unit is set as None.

        • creationTime (integer) –

          The creation time of the metric filter, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.

        • logGroupName (string) –

          The name of the log group.

        • applyOnTransformedLogs (boolean) –

          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.

    • NextToken (string) –

      A token to resume pagination.