GetConsoleOutput
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 in the Amazon EC2 User Guide.
Request Parameters
The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.
- 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 isUnauthorizedOperation.Type: Boolean
Required: No
- InstanceId
-
The ID of the instance.
Type: String
Required: Yes
- Latest
-
When enabled, retrieves the latest console output for the instance.
Default: disabled (
false)Type: Boolean
Required: No
Response Elements
The following elements are returned by the service.
- instanceId
-
The ID of the instance.
Type: String
- output
-
The console output, base64-encoded. If you are using a command line tool, the tool decodes the output for you.
Type: String
- requestId
-
The ID of the request.
Type: String
- timestamp
-
The time at which the output was last updated.
Type: Timestamp
Errors
For information about the errors that are common to all actions, see Common Error Types.
Examples
Example 1
This example retrieves the console output for the specified instance.
Sample Request
https://ec2.amazonaws.com/?Action=GetConsoleOutput
&InstanceId=i-1234567890abcdef0
&AUTHPARAMS
Sample Response
59dbff89-35bd-4eac-99ed-be587EXAMPLE
i-1234567890abcdef0
2022-10-14T01:12:41.000Z
Example 2
This example retrieves the latest console output for the specified instance.
Sample Request
https://ec2.amazonaws.com/?Action=GetConsoleOutput
&InstanceId=i-1234567890abcdef0
&Latest=true
&AUTHPARAMS
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: