Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Audit Logs: Download Logs Explorer Data as CSV or JSON & And who did what and where

Hi, I have two questions to the logs explorer product of GCP.

Context: The DB is firestore. I have editor permissions in the IAM of the GCP console. I want to get all this data using a Google Cloud Function. Currently I'm using the library "@google-cloud/logging" to get that data in js.

First, I want to get the the right data from the explorer. I only want to know what document was modified, when and by who. I can have the token of the user making that query it would be even better. I can quite get the query right. For example, I try to use this for the query "protoPayload.@type="type.googleapis.com/google.cloud.audit.AuditLog" filter but it doesn't give me the data that I'm looking for.

Second, I want to add the feature of downloading a CSV/Json file with all the data of the logs in a period of time to the user. I know that file could have a large size so I want to know how to get that data using a google cloud function in GCP Logs Explorer

0 0 374
0 REPLIES 0