# google_drive_search

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

---
title: google_drive_search
latest-operator-version: v26.2.5
latest-console-tag: v3.14.0
latest-connect-version: 4.117.0
latest-redpanda-tag: v26.2.6
docname: connect/components/processors/google_drive_search
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: connect/components/processors/google_drive_search.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/develop/pages/connect/components/processors/google_drive_search.adoc
description: Searches Google Drive for files matching the provided query.
page-git-created-date: "2025-05-19"
page-git-modified-date: "2026-10-19"
page-generated-sources:
  - include: connect:components:partial$descriptions/processors/google_drive_search.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
page-generated-content: partial
---

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

Searches Google Drive for files matching the provided query.

This processor searches for files in Google Drive using the provided query.

Search results are emitted as message batch, where each message is a [Google Drive File](https://developers.google.com/workspace/drive/api/reference/rest/v3/files#File)

## [](#authentication)Authentication

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

To use this mechanism locally, run these gcloud commands:

```bash
# Log in for the application default credentials and add scopes for read-only Drive access
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'
# When logging in with a user account, you may need to set the quota project for the application default credentials
gcloud auth application-default set-quota-project <project-id>
```

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

Otherwise if using a service account, you can create a JSON key for the service account and set it in the `credentials_json` field. In order for a service account to access files in Google Drive either files need to be explicitly shared with the service account email, otherwise [domain wide delegation](https://support.google.com/a/answer/162106) can be used to share all files within a Google Workspace.

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

### Common

```yml
processor:
  label: ""
  google_drive_search:
    credentials_json: "" # No default (optional)
    query: "" # No default (required)
    projection:
      - "id"
      - "name"
      - "mimeType"
      - "size"
      - "labelInfo"
    include_label_ids: ""
    max_results: 64
    shared_drives: false
```

### Advanced

```yml
processor:
  label: ""
  google_drive_search:
    credentials_json: "" # No default (optional)
    query: "" # No default (required)
    projection:
      - "id"
      - "name"
      - "mimeType"
      - "size"
      - "labelInfo"
    include_label_ids: ""
    max_results: 64
    shared_drives: false
```

## [](#fields)Fields

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

The JSON key for your service account (optional). If left empty, Application Default Credentials are used.

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Manage Secrets](https://docs.redpanda.com/cloud-data-platform/develop/connect/configuration/secret-management/) before adding it to your configuration.

**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/cloud-data-platform/develop/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<string>`

**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/cloud-data-platform/develop/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`

## [](#examples)Examples

### [](#search-download-files-from-google-drive)Search & download files from Google Drive

This examples downloads all the files from Google Drive that are returned in the query

```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
```