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

How to get explicit logs for move and rename actions on bucket objects?

Hello,

To be able to follow the modifications made to the files in a buckets I have set up in my company some sinks allowing to send the logs of Cloud Logging on BigQuery datasets.

Let's take this scenario:

- in a bucket bucketTest, there is a b.csv file.

- Let's move this file to a subfolder of the bucket called "test" and rename it c.csv. The file in bucketTest/b is now bucketTest/test/c.csv


We can see that the logs show these 4 different actions for the action I performed:

aalshikhley_1-1679437532209.png

My problem is the following: these 4 actions do not allow to easily know the action that a user has done. Do we have a way to have explicit logs that show the different actions performed such as renaming, moving files? And in case we have to do interpretation, can you tell me how?

Thanks in advance for your help

 

 

Solved Solved
0 2 311
1 ACCEPTED SOLUTION

The Google Cloud Storage (GCS) service provides a set of APIs .... these are documented here:

https://cloud.google.com/storage/docs/apis

These are the possible operations that can be performed against GCS.  I don't believe that there are more than that.  If we look under JSON API > API Reference > Objects we see the operations that can be performed.  In your example, you moved an object called "b.csv" to "test/c.csv".  Since there isn't a "move" API, it looks like the "logical" move was achieved by creating a new file called "test/c.csv", populating it with the content of "b.csv" and then, when done, deleting "b.csv".

When we talk about "higher level" operations such as those found in gsutil or gcloud storage, understand that these are "rich" applications that achieve their higher level constructs by performing a sequence of lower level requests (the exposed API).   GCS has no knowledge that these low level requests are part of some higher level construct (such as an object move) and, as such, doesn't have any additional information to log

View solution in original post

2 REPLIES 2

The Google Cloud Storage (GCS) service provides a set of APIs .... these are documented here:

https://cloud.google.com/storage/docs/apis

These are the possible operations that can be performed against GCS.  I don't believe that there are more than that.  If we look under JSON API > API Reference > Objects we see the operations that can be performed.  In your example, you moved an object called "b.csv" to "test/c.csv".  Since there isn't a "move" API, it looks like the "logical" move was achieved by creating a new file called "test/c.csv", populating it with the content of "b.csv" and then, when done, deleting "b.csv".

When we talk about "higher level" operations such as those found in gsutil or gcloud storage, understand that these are "rich" applications that achieve their higher level constructs by performing a sequence of lower level requests (the exposed API).   GCS has no knowledge that these low level requests are part of some higher level construct (such as an object move) and, as such, doesn't have any additional information to log

Thank you for your answer, it's very helpfull !

Top Solution Authors