:doc:`CloudWatchLogs <../../logs>` / Paginator / DescribeMetricFilters

*********************
DescribeMetricFilters
*********************



.. py:class:: CloudWatchLogs.Paginator.DescribeMetricFilters

  ::

    
    paginator = client.get_paginator('describe_metric_filters')

  
  

  .. py:method:: paginate(**kwargs)

    Creates an iterator that will paginate through responses from :py:meth:`CloudWatchLogs.Client.describe_metric_filters`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeMetricFilters>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          logGroupName='string',
          filterNamePrefix='string',
          metricName='string',
          metricNamespace='string',
          PaginationConfig={
              'MaxItems': 123,
              'PageSize': 123,
              'StartingToken': 'string'
          }
      )
      
    :type logGroupName: string
    :param logGroupName: 

      The name of the log group.

      

    
    :type filterNamePrefix: string
    :param filterNamePrefix: 

      The prefix to match. CloudWatch Logs uses the value that you set here only if you also include the ``logGroupName`` parameter in your request.

      

    
    :type metricName: string
    :param metricName: 

      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.

      

    
    :type metricNamespace: string
    :param metricNamespace: 

      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.

      

    
    :type PaginationConfig: dict
    :param PaginationConfig: 

      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.

        

      
    
    
    :rtype: 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,
                    'fieldSelectionCriteria': 'string',
                    'emitSystemFieldDimensions': [
                        'string',
                    ]
                },
            ],
            '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 <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace>`__.

                  
                

                - **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 <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html>`__.

                    

                  
                  

                  - *(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 <https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html>`__.

               

              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** *(string) --* 

              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** *(list) --* 

              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.

              
              

              - *(string) --* 
          
        
      
        

        - **NextToken** *(string) --* 

          A token to resume pagination.

          
    