Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see Google Cloud Compute Engine Logs

How can I see the logs regarding the VMs that has been created on Google Cloud Compute Engine ?

like image 645
london_utku Avatar asked Feb 21 '26 13:02

london_utku


1 Answers

Google Operations Logging (formerly Stackdriver) provides this information.

To see the details on Google Compute Engine instances that were created in a project, filter based upon the API operation v1.compute.instances.insert and the resouce type resource.type=gce_instance.

Note: the resouce type is not always necessary but it is best to be declarative in what logging should search for.

Example using the CLI:

gcloud logging read "resource.type=gce_instance protoPayload.methodName=v1.compute.instances.insert" --format json

Example using the Google Cloud Console - Legacy Logs Viewer

  • Go to https://console.cloud.google.com/logs/viewer

  • Verify that the desired Google Cloud project is displayed in the title area.

  • In the box showing the text "Filter by label or text search" click the dropdown and select "Convert to advanced filter".

  • In the box showing the text "Filter by label or text search" enter the following (as two lines in the filter box):

    resource.type="gce_instance"

    protoPayload.methodName="v1.compute.instances.insert"

  • Select the desired date search range in the box "Last hour"

  • Click the "Submit Filter" button

Example Filtered Search

like image 145
John Hanley Avatar answered Feb 25 '26 19:02

John Hanley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!