:doc:`CloudWatchLogs <../../logs>` / Client / describe_query_definitions

**************************
describe_query_definitions
**************************



.. py:method:: CloudWatchLogs.Client.describe_query_definitions(**kwargs)

  

  This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions. You can retrieve query definitions from the current account or from a source account that is linked to the current account.

   

  You can use the ``queryDefinitionNamePrefix`` parameter to limit the results to only the query definitions that have names that start with a certain string.

  

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


  **Request Syntax**
  ::

    response = client.describe_query_definitions(
        queryLanguage='CWLI'|'SQL'|'PPL',
        queryDefinitionNamePrefix='string',
        maxResults=123,
        nextToken='string'
    )
    
  :type queryLanguage: string
  :param queryLanguage: 

    The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see `Supported query languages <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html>`__.

    

  
  :type queryDefinitionNamePrefix: string
  :param queryDefinitionNamePrefix: 

    Use this parameter to filter your results to only the query definitions that have names that start with the prefix you specify.

    

  
  :type maxResults: integer
  :param maxResults: 

    Limits the number of returned query definitions to the specified number.

    

  
  :type nextToken: string
  :param nextToken: 

    The token for the next set of items to return. The token expires after 24 hours.

    

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

    
    ::

      {
          'queryDefinitions': [
              {
                  'queryLanguage': 'CWLI'|'SQL'|'PPL',
                  'queryDefinitionId': 'string',
                  'name': 'string',
                  'queryString': 'string',
                  'lastModified': 123,
                  'logGroupNames': [
                      'string',
                  ]
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **queryDefinitions** *(list) --* 

        The list of query definitions that match your request.

        
        

        - *(dict) --* 

          This structure contains details about a saved CloudWatch Logs Insights query definition.

          
          

          - **queryLanguage** *(string) --* 

            The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see `Supported query languages <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html>`__.

            
          

          - **queryDefinitionId** *(string) --* 

            The unique ID of the query definition.

            
          

          - **name** *(string) --* 

            The name of the query definition.

            
          

          - **queryString** *(string) --* 

            The query string to use for this definition. For more information, see `CloudWatch Logs Insights Query Syntax <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html>`__.

            
          

          - **lastModified** *(integer) --* 

            The date that the query definition was most recently modified.

            
          

          - **logGroupNames** *(list) --* 

            If this query definition contains a list of log groups that it is limited to, that list appears here.

            
            

            - *(string) --* 
        
      
    
      

      - **nextToken** *(string) --* 

        The token for the next set of items to return. The token expires after 24 hours.

        
  
  **Exceptions**
  
  *   :py:class:`CloudWatchLogs.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`CloudWatchLogs.Client.exceptions.ServiceUnavailableException`

  