Google Drive connector
The Google Drive connector enables searching and accessing files and folders in Google Drive.
You can create connectors in Stack Management > Connectors.
Google Drive connectors have the following configuration properties:
- Bearer Token
- A Google OAuth 2.0 access token with Google Drive API scopes. Check the Get API credentials for instructions.
You can test connectors as you're creating or editing the connector in Kibana. The test verifies connectivity by fetching the authenticated user's information from the Google Drive API.
The Google Drive connector has the following actions:
- Search files
-
Search for files in Google Drive using Google's query syntax.
- query (required): Google Drive query string. Use
fullText contains 'term'for content search,name contains 'term'for filename search,mimeType='application/pdf'for type filtering,modifiedTime > '2024-01-01'for date filtering. Combine withand/or. - pageSize (optional): Maximum number of files to return (1–1000). Defaults to 250.
- pageToken (optional): Token for pagination from a previous response.
- orderBy (optional): Sort order. Valid values:
createdTime,createdTime desc,modifiedTime,modifiedTime desc,name,name desc.
- query (required): Google Drive query string. Use
- List files
-
List files and subfolders in a Google Drive folder.
- folderId (optional): Parent folder ID. Use
rootfor the root folder, or a folder ID from search/list results. Defaults toroot. - pageSize (optional): Maximum number of files to return (1–1000). Defaults to 250.
- pageToken (optional): Token for pagination from a previous response.
- orderBy (optional): Sort order:
name,modifiedTime, orcreatedTime. - includeTrashed (optional): Include trashed files in results. Defaults to
false.
- folderId (optional): Parent folder ID. Use
- Download file
-
Download a file's content. For native files (PDF, DOCX, etc.), downloads the file directly. For Google Workspace documents (Docs, Sheets, Slides), exports to a standard format (PDF for documents, XLSX for spreadsheets).
- fileId (required): The ID of the file to download.
- Get file metadata
-
Get detailed metadata for specific files, including ownership, sharing status, permissions, and descriptions. Use after search or list to inspect specific files.
- fileIds (required): Array of file IDs to fetch metadata for. Returns:
id,name,mimeType,size,createdTime,modifiedTime,owners,lastModifyingUser,sharingUser,shared,starred,trashed,permissions,description,parents,labelInfo,webViewLink.
- fileIds (required): Array of file IDs to fetch metadata for. Returns:
Use the Action configuration settings to customize connector networking configurations, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use xpack.actions.customHostSettings to set per-host configurations.
To use the Google Drive connector, you need a Google OAuth 2.0 access token with Drive API scopes. You can obtain one using the Google OAuth 2.0 Playground:
- Open the OAuth 2.0 Playground.
- In the list of APIs, select Drive API v3 and choose the
https://www.googleapis.com/auth/drive.readonlyscope (orhttps://www.googleapis.com/auth/drivefor full access). - Click Authorize APIs and sign in with your Google account.
- Click Exchange authorization code for tokens.
- Copy the Access token and use it as the Bearer Token in the connector configuration.