---
title: BigQuery
summary: Fastly will upload log messages to the Google BigQuery dataset and table in the format specified in the BigQuery logging object.
url: https://www.fastly.com/documentation/reference/api/logging/bigquery
---

Fastly will upload log messages to the Google BigQuery dataset and table in the format specified in the BigQuery logging object.

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `dataset` | string | Your BigQuery dataset. |
| `format` | string | A Fastly <a href="https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/">log format string</a>. Must produce JSON that matches the schema of your BigQuery table. |
| `name` | string | The name of the BigQuery logging object. Used as a primary key for API access. |
| `project_id` | string | Your Google Cloud Platform project ID. Required. |
| `table` | string | Your BigQuery table. |
| `template_suffix` | string | BigQuery table name suffix template. Optional. |
| `account_name` | string | The name of the Google Cloud Platform service account associated with the target log collection service. Not required if <code>user</code> and <code>secret_key</code> are provided. |
| `format_version` | integer | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in <code>vcl_log</code> if <code>format_version</code> is set to <code>2</code> and in <code>vcl_deliver</code> if <code>format_version</code> is set to <code>1</code>. |
| `log_processing_region` | string | The geographic region where the logs will be processed before streaming. Valid values are <code>us</code>, <code>eu</code>, and <code>none</code> for global. |
| `placement` | string | Where in the generated VCL the logging call should be placed. If not set, endpoints with <code>format_version</code> of 2 are placed in <code>vcl_log</code> and those with <code>format_version</code> of 1 are placed in <code>vcl_deliver</code>. |
| `response_condition` | string | The name of an existing condition in the configured endpoint, or leave blank to always execute. |
| `secret_key` | string | Your Google Cloud Platform account secret key. The <code>private_key</code> field in your service account authentication JSON. Not required if <code>account_name</code> is specified. |
| `user` | string | Your Google Cloud Platform service account email address. The <code>client_email</code> field in your service account authentication JSON. Not required if <code>account_name</code> is specified. |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `deleted_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `service_id` | string | Alphanumeric string identifying the service. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `version` | string | String identifying a service version. (Read-only) |

## API endpoints

### List BigQuery log endpoints

**GET** `/service/{service_id}/version/{version_id}/logging/bigquery`

List all of the BigQuery logging objects for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Create a BigQuery log endpoint

**POST** `/service/{service_id}/version/{version_id}/logging/bigquery`

Create a BigQuery logging object for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Get a BigQuery log endpoint

**GET** `/service/{service_id}/version/{version_id}/logging/bigquery/{logging_bigquery_name}`

Get the details for a BigQuery logging object for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_bigquery_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Update a BigQuery log endpoint

**PUT** `/service/{service_id}/version/{version_id}/logging/bigquery/{logging_bigquery_name}`

Update a BigQuery logging object for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_bigquery_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

### Delete a BigQuery log endpoint

**DELETE** `/service/{service_id}/version/{version_id}/logging/bigquery/{logging_bigquery_name}`

Delete a BigQuery logging object for a particular service and version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `logging_bigquery_name` | string | path | Yes | The name for the real-time logging configuration. |
| `service_id` | string | path | Yes | Alphanumeric string identifying the service. |
| `version_id` | integer | path | Yes | Integer identifying a service version. |

