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

***************************
get_scheduled_query_history
***************************



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

  

  Retrieves the execution history of a scheduled query within a specified time range, including query results and destination processing status.

  

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


  **Request Syntax**
  ::

    response = client.get_scheduled_query_history(
        identifier='string',
        startTime=123,
        endTime=123,
        executionStatuses=[
            'Running'|'InvalidQuery'|'Complete'|'Failed'|'Timeout',
        ],
        maxResults=123,
        nextToken='string'
    )
    
  :type identifier: string
  :param identifier: **[REQUIRED]** 

    The ARN or name of the scheduled query to retrieve history for.

    

  
  :type startTime: integer
  :param startTime: **[REQUIRED]** 

    The start time for the history query in Unix epoch format.

    

  
  :type endTime: integer
  :param endTime: **[REQUIRED]** 

    The end time for the history query in Unix epoch format.

    

  
  :type executionStatuses: list
  :param executionStatuses: 

    An array of execution statuses to filter the history results. Only executions with the specified statuses are returned.

    

  
    - *(string) --* 

    

  :type maxResults: integer
  :param maxResults: 

    The maximum number of history records to return. Valid range is 1 to 1000.

    

  
  :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**

    
    ::

      {
          'name': 'string',
          'scheduledQueryArn': 'string',
          'triggerHistory': [
              {
                  'queryId': 'string',
                  'executionStatus': 'Running'|'InvalidQuery'|'Complete'|'Failed'|'Timeout',
                  'triggeredTimestamp': 123,
                  'errorMessage': 'string',
                  'destinations': [
                      {
                          'destinationType': 'S3',
                          'destinationIdentifier': 'string',
                          'status': 'IN_PROGRESS'|'CLIENT_ERROR'|'FAILED'|'COMPLETE',
                          'processedIdentifier': 'string',
                          'errorMessage': 'string'
                      },
                  ]
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The name of the scheduled query.

        
      

      - **scheduledQueryArn** *(string) --* 

        The ARN of the scheduled query.

        
      

      - **triggerHistory** *(list) --* 

        An array of execution history records for the scheduled query.

        
        

        - *(dict) --* 

          A record of a scheduled query execution, including execution status, timestamp, and destination processing results.

          
          

          - **queryId** *(string) --* 

            The unique identifier for this query execution.

            
          

          - **executionStatus** *(string) --* 

            The execution status of the scheduled query run.

            
          

          - **triggeredTimestamp** *(integer) --* 

            The timestamp when the scheduled query execution was triggered.

            
          

          - **errorMessage** *(string) --* 

            Error message if the query execution failed.

            
          

          - **destinations** *(list) --* 

            Information about destination processing for this query execution.

            
            

            - *(dict) --* 

              Information about a destination where scheduled query results are processed, including processing status and any error messages.

              
              

              - **destinationType** *(string) --* 

                The type of destination for query results.

                
              

              - **destinationIdentifier** *(string) --* 

                The identifier for the destination where results are delivered.

                
              

              - **status** *(string) --* 

                The processing status of the destination delivery.

                
              

              - **processedIdentifier** *(string) --* 

                The identifier of the processed result at the destination.

                
              

              - **errorMessage** *(string) --* 

                Error message if destination processing failed.

                
          
        
      
    
      

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

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

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

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

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

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

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

  