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
- 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.
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
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.
- Logs View Accessor (
- 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:
-
In the Google Cloud console, go to the manage_search Observability Analytics page:
If you use the search bar to find this page, then select the result whose subheading is Logging.
In the Log views list, find and select the log view.
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.
In the toolbar, expand the button labeled Run query or Run on BigQuery, and select Open in BigQuery.
BigQuery Studio opens. The
FROMstatement 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.
On BigQuery Studio, click Run query.
Pricing
To learn about the costs associated with using BigQuery, see BigQuery pricing.
What's next
- Monitor your SQL query results with an alerting policy
- Save and share a SQL query
- Sample SQL queries
- Chart SQL query results