:doc:`CloudWatch <../../cloudwatch>` / Client / describe_insight_rules

**********************
describe_insight_rules
**********************



.. py:method:: CloudWatch.Client.describe_insight_rules(**kwargs)

  

  Returns a list of all the Contributor Insights rules in your account.

   

  For more information about Contributor Insights, see `Using Contributor Insights to Analyze High-Cardinality Data <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeInsightRules>`_  


  **Request Syntax**
  ::

    response = client.describe_insight_rules(
        NextToken='string',
        MaxResults=123
    )
    
  :type NextToken: string
  :param NextToken: 

    Include this value, if it was returned by the previous operation, to get the next set of rules.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return in one operation. If you omit this parameter, the default of 500 is used.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'NextToken': 'string',
          'InsightRules': [
              {
                  'Name': 'string',
                  'State': 'string',
                  'Schema': 'string',
                  'Definition': 'string',
                  'ManagedRule': True|False,
                  'ApplyOnTransformedLogs': True|False
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        If this parameter is present, it is a token that marks the start of the next batch of returned results.

        
      

      - **InsightRules** *(list) --* 

        The rules returned by the operation.

        
        

        - *(dict) --* 

          This structure contains the definition for a Contributor Insights rule. For more information about this rule, see `Using Constributor Insights to analyze high-cardinality data <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html>`__ in the *Amazon CloudWatch User Guide*.

          
          

          - **Name** *(string) --* 

            The name of the rule.

            
          

          - **State** *(string) --* 

            Indicates whether the rule is enabled or disabled.

            
          

          - **Schema** *(string) --* 

            For rules that you create, this is always ``{"Name": "CloudWatchLogRule", "Version": 1}``. For managed rules, this is ``{"Name": "ServiceLogRule", "Version": 1}``

            
          

          - **Definition** *(string) --* 

            The definition of the rule, as a JSON object. The definition contains the keywords used to define contributors, the value to aggregate on if this rule returns a sum instead of a count, and the filters. For details on the valid syntax, see `Contributor Insights Rule Syntax <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html>`__.

            
          

          - **ManagedRule** *(boolean) --* 

            An optional built-in rule that Amazon Web Services manages.

            
          

          - **ApplyOnTransformedLogs** *(boolean) --* 

            Displays whether the rule is evaluated on the transformed versions of logs, for log groups that have `Log transformation <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html>`__ enabled. If this is ``false``, log events are evaluated before they are transformed.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`CloudWatch.Client.exceptions.InvalidNextToken`

  