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

**********
stop_query
**********



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

  

  Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.

   

  This operation can be used to cancel both interactive queries and individual scheduled query executions. When used with scheduled queries, ``StopQuery`` cancels only the specific execution identified by the query ID, not the scheduled query configuration itself.

  

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


  **Request Syntax**
  ::

    response = client.stop_query(
        queryId='string'
    )
    
  :type queryId: string
  :param queryId: **[REQUIRED]** 

    The ID number of the query to stop. To find this ID number, use ``DescribeQueries``.

    

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

    
    ::

      {
          'success': True|False
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **success** *(boolean) --* 

        This is true if the query was stopped by the ``StopQuery`` operation.

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

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

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

  