Query log data with BigQuery Studio

This document describes how to query your log data from BigQuery Studio. When you use BigQuery Studio, you can join your log data with other business data, and you can analyze your datasets using commands, workflows, and datasets available only in BigQuery Studio.

If you aren't familiar with Observability Analytics, then see Observability Analytics overview.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  5. Verify that billing is enabled for your Google Cloud project.

  6. To get the permissions that you need to query a linked dataset from BigQuery Studio, ask your administrator to grant you the following IAM roles:

    • Logs View Accessor (roles/logging.viewAccessor) on the project or on the view that you want to query.
    • BigQuery Data Viewer (roles/bigquery.dataViewer) on the project or on the linked BigQuery dataset.

    For more information about granting roles, see Manage access to projects, folders, and organizations.

    You might also be able to get the required permissions through custom roles or other predefined roles.

  7. Verify that you have a linked BigQuery dataset on your log bucket. If the dataset doesn't exist, then create it.

Run queries from BigQuery Studio

To open BigQuery from the Observability Analytics and then query your log data, do the following:

  1. In the Google Cloud console, go to the Observability Analytics page:

    Go to Observability Analytics

    If you use the search bar to find this page, then select the result whose subheading is Logging.

  2. In the Log views list, find and select the log view.

  3. In the Schema pane, select Query.

    The Query pane is populated with a default query. You can also enter a query in the Query pane, or edit a displayed query.

  4. In the toolbar, expand the button labeled Run query or Run on BigQuery, and select Open in BigQuery.

    BigQuery Studio opens. The FROM statement of the query is modified to specify the path to the log view on the linked dataset by using the BigQuery Table path syntax.

    You can also edit the displayed query.

  5. On BigQuery Studio, click Run query.

Pricing

To learn about the costs associated with using BigQuery, see BigQuery pricing.

What's next