:doc:`EC2 <../../ec2>` / Client / get_console_output

******************
get_console_output
******************



.. py:method:: EC2.Client.get_console_output(**kwargs)

  

  Gets the console output for the specified instance. For Linux instances, the instance console output displays the exact console output that would normally be displayed on a physical monitor attached to a computer. For Windows instances, the instance console output includes the last three system event log errors.

   

  For more information, see `Instance console output <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output>`__ in the *Amazon EC2 User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput>`_  


  **Request Syntax**
  ::

    response = client.get_console_output(
        InstanceId='string',
        Latest=True|False,
        DryRun=True|False
    )
    
  :type InstanceId: string
  :param InstanceId: **[REQUIRED]** 

    The ID of the instance.

    

  
  :type Latest: boolean
  :param Latest: 

    When enabled, retrieves the latest console output for the instance.

     

    Default: disabled ( ``false``)

    

  
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

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

    
    ::

      {
          'InstanceId': 'string',
          'Timestamp': datetime(2015, 1, 1),
          'Output': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **InstanceId** *(string) --* 

        The ID of the instance.

        
      

      - **Timestamp** *(datetime) --* 

        The time at which the output was last updated.

        
      

      - **Output** *(string) --* 

        The console output, base64-encoded. If you are using a command line tool, the tool decodes the output for you.

        
  

  **Examples**

  This example gets the console output for the specified instance.
  ::

    response = client.get_console_output(
        InstanceId='i-1234567890abcdef0',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'InstanceId': 'i-1234567890abcdef0',
        'Output': '...',
        'Timestamp': datetime(2018, 5, 25, 21, 23, 53, 4, 145, 0),
        'ResponseMetadata': {
            '...': '...',
        },
    }

  