Skip to content

dataform-co/dataform-bq-audit-logs

Repository files navigation

**** 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: https://cloud.google.com/bigquery/docs/information-schema-jobs ****

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

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

<iframe src="https://www.loom.com/embed/fdfa25dcdc8544e38fe844199b970f87" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>

Supported warehouses

  • BigQuery

Installation

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:

const bigQueryLogs = require("dataform-bigquery-logs");

const bigQueryLogsModels = bigQueryLogs({
  logsSchema: "stackdriver_logs",
  defaultConfig: {
    tags: ["bq_audit_logs"],
    type: "view"
  },
});

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).

bigquery_compute_logs

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!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •