BigQuery Audit Logs

**** NOTE: This package was created before the "Jobs" information schema tables were available in BigQuery. **** **** We recommended that you use the information schema tables instead of this package **** **** Learn more: ****

This package creates a simple dataset to aid analysis of BigQuery usage logs.

To set up BigQuery audit data logging, follow the instructions here.

Supported warehouses

  • BigQuery


Add the package to your package.json file in your Dataform project. You can find the most up to package version on the releases page.

Configure the package

Create a new JS file in your definitions/ folder and create the BigQuery table with the following snippet:

1const bigQueryLogs = require("dataform-bigquery-logs");
3const bigQueryLogsModels = bigQueryLogs({
4  logsSchema: "stackdriver_logs",
5  defaultConfig: {
6    tags: ["bq_audit_logs"],
7    type: "view"
8  },

For more advanced uses cases, see the example.js.

Data models

This output of this package is the following data model (configurable as tables or views).


One row for every query log sent from BigQuery to stackdriver. The schema of this table is significantly simplified as compared to the raw logs table!

What's next

Create new packages

Learn how to create new packages on Dataform.

Contribute to an existing package

Learn how to make improvements to an existing package

Fivetran Logs


Slowly changing dimensions

Stripe (Fivetran)