image
DEMO: List Log Entries by Using API Explorer
Start course
Difficulty
Intermediate
Duration
22m
Students
103
Ratings
5/5
starstarstarstarstar
Description

This course looks at how to use and manage cloud logging on the GCP platform and includes demos from GCP that you can follow along with.

We'll cover writing and listing log entries using gcloud, how you can use the API Explorer to list log entries, and how you can view logs and query log entries using Logs Explorer. We'll then move on to cloud audit logs including an overview of the different types of logs, as well as looking at audit log retention, and how you can view audit logs and export audit logs.

Learning Objectives

  • Write and list log entries with gcloud
  • List log entries using API explorer
  • View logs in the Logs Explorer
  • Learn how to view, export, and retain audit logs

Intended Audience

This course is intended for anyone who wants to learn how to use and manage cloud logging on the GCP platform.

Prerequisites

To get the most out of this course, you should already have a basic understanding of GCP and know your way around the platform.

Transcript

Hello and welcome back. In this demonstration here what we're gonna do is list out the log entries for our project using the API Explorer.

Now the API Explorer is a bit of an unusual tool comparatively speaking. It's actually a widget that's attached to the REST API reference page for each different method. It's really just a panel off to the side with an area labeled, "Try this API." You can use the API Explorer in GCP to view a list of log entries from logging.

Now in this quick demonstration, we'll use the API Explorer to view log entries for our Cloud Academy project. Now on the screen here, we're right where we left off in our last demo. But what I'm gonna do here is switch over to this tab up here which I've opened. This is the entries list method. Remember, this is the reference page that I just mentioned.

Now, if you look over to the right-hand side here we see this, try this API widget. Now what we're gonna do is paste in a request into the request body, and then we're going to execute it. Now instead of typing in the complete request, I'm going to paste in the request from my note pad off screen here. And then I'll explain it to you before we execute it.

So I'm gonna go ahead and copy this over here, and then we'll paste in to the request body. So this is a pretty straightforward request here in JSON format. Now what we're doing here, if I scroll down here just so I can match up the fields. The resource names here, refers to the resources from where we're going to retrieve the logs. And this resource here is the Cloud Academy Content Team Project.

So we're pulling our data from the Cloud Academy Content Team Project. We're filtering on global resource types, and then we're ordering things by the timestamp descending. So it's a pretty straightforward request here.

So now that we have this request in the try this API request body field here, we can go ahead and execute it. Now what this will do is require me to sign in with an account that has access here. So we'll log in with our Cloud Academy account. And it's making sure I'm allowing it. And we see we have a 200 here, everything's green. And if we scroll down, we can see all of the fields that are included in our logs.

So what we've done is used the API Explorer to list out the log entries for all of the logs within our Cloud Academy project.

About the Author
Students
84266
Courses
86
Learning Paths
64

Tom is a 25+ year veteran of the IT industry, having worked in environments as large as 40k seats and as small as 50 seats. Throughout the course of a long an interesting career, he has built an in-depth skillset that spans numerous IT disciplines. Tom has designed and architected small, large, and global IT solutions.

In addition to the Cloud Platform and Infrastructure MCSE certification, Tom also carries several other Microsoft certifications. His ability to see things from a strategic perspective allows Tom to architect solutions that closely align with business needs.

In his spare time, Tom enjoys camping, fishing, and playing poker.