
Answer-first summary for fast verification
Answer: Use Cloud Audit Logging to view Cloud Audit Logs, and create a filter on the query operation to get the required information.
The question requires determining the number of queries executed by each user in the last month for audit purposes. Option D (Use Cloud Audit Logging) is the correct answer because Cloud Audit Logs are the definitive source for audit and security questions, capturing detailed information about who ran what queries, when, and how. They are automatically enabled for BigQuery and support organization-wide visibility, making them suitable for auditing across all users and projects. Option B (querying the JOBS table) is less suitable because it refers to a 'table' rather than the correct INFORMATION_SCHEMA.JOBS_BY_USER view, and it may require specific permissions (e.g., BigQuery Resource Viewer) that are not guaranteed for all users in an audit scenario. Option A (Google Data Studio) is for visualization and does not directly retrieve the data. Option C (using 'bq show' and 'bq ls') is inefficient for monthly aggregation and does not scale well. The community discussion strongly supports D, with high upvotes and reasoning that audit logs are optimal for security and compliance, while B is noted as potentially incorrect due to terminology and permission issues.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
Your BigQuery project has multiple users. For auditing, you need to determine the number of queries executed by each user in the previous month. What is the correct approach?
A
Connect Google Data Studio to BigQuery. Create a dimension for the users and a metric for the amount of queries per user.
B
In the BigQuery interface, execute a query on the JOBS table to get the required information.
C
Use 'bq show' to list all jobs. Per job, use 'bq ls' to list job information and get the required information.
D
Use Cloud Audit Logging to view Cloud Audit Logs, and create a filter on the query operation to get the required information.