menu

Using BigQuery and Stackdriver to Analyze BigQuery Usage

Go to Lab

108 Reviews

Valerii T. · Reviewed 2 days ago

Jason C. · Reviewed 3 days ago

Thanaphoom B. · Reviewed 3 days ago

Eshita N. · Reviewed 4 days ago

Luke G. · Reviewed 5 days ago

Luke G. · Reviewed 7 days ago

This was nice!

Tané T. · Reviewed 9 days ago

kunihiko u. · Reviewed 10 days ago

GODFREY M. · Reviewed 12 days ago

くりす F. · Reviewed 14 days ago

perfect

Majd J. · Reviewed 16 days ago

Saswat D. · Reviewed 16 days ago

Ray L. · Reviewed 16 days ago

Brian T. · Reviewed 19 days ago

Hoang L. · Reviewed 19 days ago

Arnaldo P. · Reviewed 19 days ago

Hiếu N. · Reviewed 20 days ago

Eric K. · Reviewed 20 days ago

The most important query to pull the logs did not work even after making changes to the GCP Project ID as suggested. CREATE OR REPLACE VIEW bq_logs.v_querylogs AS SELECT resource.labels.project_id, protopayload_auditlog.authenticationInfo.principalEmail, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobConfiguration.query.query, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobConfiguration.query.statementType, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatus.error.message, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime, TIMESTAMP_DIFF(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.endTime, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.startTime, MILLISECOND)/1000 AS run_seconds, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalProcessedBytes, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalSlotMs, ARRAY(SELECT as STRUCT datasetid, tableId FROM UNNEST(protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.referencedTables)) as tables_ref, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.totalTablesProcessed, protopayload_auditlog.servicedata_v1_bigquery.jobCompletedEvent.job.jobStatistics.queryOutputRowCount, severity FROM `<YOUR-PROJECT-ID>.bq_logs.cloudaudit_googleapis_com_data_access_*` ORDER BY startTime

Phani Kiran Sai V. · Reviewed 21 days ago

Ignacio B. · Reviewed 21 days ago

ok

gary l. · Reviewed 23 days ago

Kashyap D. · Reviewed 24 days ago

Sateesh K. · Reviewed 24 days ago

Huy D. · Reviewed 24 days ago

kumar b. · Reviewed 25 days ago