D- reasons:
1.-Cloud Audit Logs maintains audit logs for admin activity, data access and system events. BIGQUERY is automatically send to cloud audit log functionality.
2.- In the filter you can filter relevant BigQuery Audit messages, you can express filters as part of the export
https://cloud.google.com/logging/docs/audit
https://cloud.google.com/bigquery/docs/reference/auditlogs#ids
https://cloud.google.com/bigquery/docs/reference/auditlogs#auditdata_examples
D is the right as you can get the monthly view of the query usage across all the users and projects for auditing purpose. C does need appropriate permission to see the detail level data. Monthly view is tough to get directly from the bq ls or bq show commands.
I agree B could be the solution, but the best option is D.
This is the correct and scalable approach:
Cloud Audit Logs capture who ran what, including queries.
You can filter on methodName = "jobservice.jobcompleted" and analyze logs in Logs Explorer or export to BigQuery for querying.
Supports organization-wide, project-wide, and per-user visibility.
B is correct. Go search in Gemini "what are the steps to execute a query on the JOBS table in Bigquery to see how many queries each user ran in the last month." to see how easy are the steps.
answer is B, fastest and efficient method. Question said that they just need to know "how many queries each user ran in the last month" which B can do in a short time.
BigQuery's INFORMATION_SCHEMA: BigQuery provides metadata about datasets, tables, and jobs through the INFORMATION_SCHEMA. The JOBS_BY_USER view within this schema is specifically designed to give you information about jobs run by each user. You can easily query this view to get the number of queries run by each user in the last month.
"Audit logs versus INFORMATION_SCHEMA views
Audit logs help you answer the question "Who did what, where, and when?" within your Google Cloud resources. Audit logs are the definitive source of information for system activity by user and access patterns and should be your primary source for audit or security questions."
https://cloud.google.com/bigquery/docs/introduction-audit-workloads
Answer is B
In the BigQuery interface, execute a query on the JOBS table to get the required
information.
Explanation:
JOBS Table:BigQuery automatically logs job information, including queries, in a special table called JOBS.
By querying this table, you can retrieve details about each job, including the user who ran it, the query text, and the timestamp.
Why the Other Options Are Less Suitable:
Connect Google Data Studio to BigQuery: While this can visualize data, you still need to execute a query to pull the data first. This option is not directly querying for the information you need.
Use ‘bq show’ and ‘bq ls’: These commands provide metadata about jobs but do not efficiently retrieve the count of queries per user, especially for a large number of jobs over a month.
Use Cloud Audit Logging: This approach could work but would be more complex and less efficient for simply counting queries. The JOBS table is specifically designed for this purpose, making it easier to extract the necessary data.
Using the INFORMATION_SCHEMA.JOBS_BY_USER table within BigQuery is the most efficient and straightforward method to get the required audit information about the number of queries each user ran in the last month. Therefore, option B is the best choice.. D.While Cloud Audit Logs can provide detailed logs of activities, querying them directly for this purpose is less efficient than using the JOBS table in BigQuery. Additionally, setting up and querying audit logs involves more steps and may require exporting logs to BigQuery for complex queries.
Why B is the Best Answer:
Direct Access to Job Metadata: BigQuery maintains metadata about jobs (including query jobs) in the INFORMATION_SCHEMA views, specifically in the INFORMATION_SCHEMA.JOBS table.
Detailed Information: This table contains information about all jobs, including who ran them, when they were run, and the type of job. This makes it easy to filter and count queries by user.
Querying JOBS Table: You can write a SQL query to count the number of queries executed by each user over the specified period.
Querying the INFORMATION_SCHEMA.JOBS_BY_USER view in BigQuery is the most efficient and straightforward way to obtain the number of queries each user ran in the last month. This method leverages built-in BigQuery capabilities designed specifically for auditing and monitoring query jobs.
Cloud Audit Logs provide detailed logging information but are more complex to query for specific metrics like the number of queries run by each user. BigQuery’s INFORMATION_SCHEMA.JOBS_BY_USER is designed for this purpose and is easier to use for querying job data.
reason:
https://cloud.google.com/logging/docs/audit#data-access
Data Access audit logs—except for BigQuery Data Access audit logs—are disabled by default because audit logs can be quite large. If you want Data Access audit logs to be written for Google Cloud services other than BigQuery, you must explicitly enable them
I finally decide to go with Option D over B because we or the auditor might not have access to the metadata. In fact, in our project, not all of us had access to query this view.
"To get the permission that you need to query the INFORMATION_SCHEMA.JOBS view, ask your administrator to grant you the BigQuery Resource Viewer"
https://cloud.google.com/bigquery/docs/information-schema-jobs#required_role.
(And not because of the wordings "Table" instead of "view" - don't think an architect exam will try to assess your memory of whether it is a table or a view or your understanding of the difference between a table and a view).
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Googler2
Highly Voted 5 years agoGooglecloudArchitect
4 years, 9 months agoheretolearnazure
1 year, 8 months agoZarmi
Highly Voted 4 years, 11 months agoBobbyFlash
3 years, 4 months agoErenYeager
2 years, 5 months agofrancisco94
Most Recent 2 weeks, 3 days agoMikeliz
1 month, 3 weeks agodavid_tay
1 month, 4 weeks agoPetarMarinkovic
2 months agodavid_tay
2 months ago1P5811
3 months, 1 week agoJonathanSJ
3 months, 4 weeks agoalpay
5 months agonareshthumma
6 months agoawsgcparch
9 months agoawsgcparch
9 months agoeff12c1
10 months, 3 weeks agoJaimeMS
10 months, 4 weeks agoAhmedSami
1 year, 2 months agoSSS987
1 year, 3 months ago