# google_drive_search

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: google_drive_search
latest-connect-version: 4.93.0
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-redpanda-tag: v26.1.9
docname: processors/google_drive_search
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: processors/google_drive_search.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/processors/google_drive_search.adoc
page-git-created-date: "2025-05-19"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/connect/components/processors/google_drive_search.md -->

**Available in:** [Cloud](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/google_drive_search/%20%22View%20the%20Cloud%20version%20of%20this%20component%22), Self-Managed

**License**: This component requires an [enterprise license](https://docs.redpanda.com/redpanda-connect/get-started/licensing/). You can either [upgrade to an Enterprise Edition license](https://www.redpanda.com/upgrade), or [generate a trial license key](http://redpanda.com/try-enterprise) that's valid for 30 days.

Searches Google Drive for files that match a specified query and emits the results as a batch of messages. Each message contains the [metadata of a Google Drive file](https://developers.google.com/workspace/drive/api/reference/rest/v3/files#File).

Try out the [example pipeline on this page](#example), which searches for and downloads all Google Drive files that match the specified query.

Introduced in version 4.53.0.

```yml
# Configuration fields, showing default values
label: ""
google_drive_search:
  credentials_json: "" # No default (optional)
  query: "" # No default (required)
  projection:
    - id
    - name
    - mimeType
    - size
    - labelInfo
  include_label_ids: "" # No default (optional)
  max_results: 64
```

## [](#authentication)Authentication

By default, this processor uses [Google Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials) to authenticate with Google APIs.

To set up local ADC authentication, use the following `gcloud` commands:

-   Authenticate using Application Default Credentials and grant read-only access to your Google Drive.

    ```bash
    gcloud auth application-default login --scopes='openid,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive.readonly'
    ```

-   Assign a quota project to the Application Default Credentials when using a user account.

    ```bash
    gcloud auth application-default set-quota-project <project-id>
    ```

    Replace the `<project-id>` placeholder with your Google Cloud project ID


To use a service account instead, create a JSON key for the account and add it to the [`credentials_json`](#credentials_json) field. To access Google Drive files using a service account, either:

-   Explicitly share files with the service account’s email account

-   Use [domain-wide delegation](https://support.google.com/a/answer/162106) to share all files within a Google Workspace


## [](#fields)Fields

### [](#credentials_json)`credentials_json`

The JSON key for your service account (optional). If left empty, Application Default Credentials are used. For more details, see [Authentication](#authentication).

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

**Type**: `string`

### [](#include_label_ids)`include_label_ids`

A comma delimited list of label IDs to include in the Google Drive search result. This field supports [interpolation functions](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries).

**Type**: `string`

**Default**: `""`

### [](#max_results)`max_results`

The maximum number of search results to return.

**Type**: `int`

**Default**: `64`

### [](#projection)`projection[]`

Partial fields to include in the Google Drive search result.

**Type**: `array`

**Default**:

```yaml
- "id"
- "name"
- "mimeType"
- "size"
- "labelInfo"
```

### [](#query)`query`

Specify a search query to locate matching files in Google Drive. This field supports:

-   The same query syntax as the Google Drive UI

-   [Bloblang interpolation functions](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries) for dynamic query generation


**Type**: `string`

### [](#shared_drives)`shared_drives`

Whether or not to include shared drives in the result.

**Type**: `bool`

**Default**: `false`

## [](#example)Example

This example searches Google Drive for files matching a query and downloads each file to a specified location. It uses the `google_drive_search` processor to perform the search and the [`google_drive_download` processor](https://docs.redpanda.com/connect/components/processors/google_drive_download/) to retrieve the files.

```yaml
input:
  stdin: {}
pipeline:
  processors:
    - google_drive_search:
        query: "${!content().string()}"
    - mutation: 'meta path = this.name'
    - google_drive_download:
        file_id: "${!this.id}"
        mime_type: "${!this.mimeType}"
output:
  file:
    path: "${!@path}"
    codec: all-bytes
```