# Send data to Google Cloud Storage

{% hint style="info" %}
See the changelog of the **Google Cloud Storage** Data sink type [here](/data-sinks/google-cloud-storage-data-sink.md).
{% endhint %}

## Overview

Onum supports integration with [Google Cloud Storage](https://cloud.google.com/storage?hl=en).

Google Cloud Storage is an online object storage service that allows users to store and retrieve data. It is a managed service, meaning Google handles the underlying infrastructure, making it scalable and reliable. GCS is designed for a variety of use cases, including storing data for web applications, big data analytics, and backups.&#x20;

## Prerequisites

You will need:

* a [Google Cloud account](mailto:undefined)
* an existing project in the [Google Cloud Console](https://console.cloud.google.com/projectselector2/home/dashboard)

## Google Cloud Storage Setup&#x20;

* Once you have your project to connect to, make sure your user or service account has the proper roles e.g. `roles/storage.admin`  Go to **IAM & Admin > IAM > Add Principal** and choose a role.
* Enable the **Cloud Storage API** in your project.

## Onum setup

{% stepper %}
{% step %}
Log in to your Onum tenant and click **Data Sinks> New Data sink**.
{% endstep %}

{% step %}
Double-click the **Google Cloud Storage** Sink.
{% endstep %}

{% step %}
Enter a **Name** for the new Data Sink. Optionally, add a **Description** and some **Tags** to identify the Sink.
{% endstep %}

{% step %}
Decide whether or not to include this Data sink info in the metrics and graphs of the [**Home**](/the-workspace/home.md) area.
{% endstep %}

{% step %}
The **Bucket name**<mark style="color:red;">**\***</mark> field is the bucket that will contain your data. Access **Buckets** and enter the required bucket name here.

<figure><img src="/files/yXpPJcKqpEGNsr5ohef4" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Choose the required **Batch type**<mark style="color:red;">**\***</mark>:

* **Send after (X minutes)** - Choose this option if you want to send data after a specific time. Enter the required time in the **Period** parameter below.
* **Number of events** - Choose this option if you want to send data after a specific number of events is reached. Enter the required event amount in the **Number of events** parameter below.
  {% endstep %}

{% step %}
After choosing the type, configure the specifics:

* **Period** If you select **Send after (X minutes)** as your **Batch type**, enter the number of minutes to wait before considering the batch completed. The minimum value is `1`, and the maximum value is `10`.
* **Number of events** If you select **Number of events** as your **Batch type**, enter how many to collect until considered full. The minimum value is `1`.
* **Max number of unique buffers** Enter the maximum amount of buffers. The maximum value is `50`.
* **Compression** Choose **Bzip2** or **Gzip** if you wish to compress your events, or **None** if not. If you are sending events in bzip, you´ll need to unzip them upon download.\
  If you're sending gzip-compressed data, the file unzips automatically when you download it.
  {% endstep %}

{% step %}
The Google Cloud Storage connector uses OAuth 2.0 credentials for authentication and authorization.&#x20;

Enter the **Credentials File**<mark style="color:red;">**\***</mark> by creating a [secret](/administration/tenant-menu.md) containing these credentials or select one already created. To find the credentials file:

1. Go to Google Cloud **Settings > Interoperability**.
2. Scroll down to the **Service Account** area.
3. You need to generate and download a **service account key** from the Google Cloud Console. You will not be able to view this key, so you must have it copied somewhere already. Otherwise, create one here and save it to paste here.
4. To see existing Service Accounts, go to the menu in the top left and select **APIs & Services > Credentials**.

<figure><img src="/files/t15BPftuN6tUgtso7Vwj" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Click **New secret** to create a new one:

* Give the secret a **Name**.
* Turn off the **Expiration date** option.
* Click **Add new value** and paste the secret corresponding to the JWT token you generated before. Remember that the token will be added in the Zscaler configuration.
* Click **Save**.

<figure><picture><source srcset="/files/NeeWsSQzoChVxRIY76Nt" media="(prefers-color-scheme: dark)"><img src="/files/1oTccyPmgZJ1laY7IhZH" alt=""></picture><figcaption></figcaption></figure>

{% hint style="info" %}
Learn more about secrets in Onum in [this article](/administration/global-settings/organization-settings/secrets-management.md).
{% endhint %}
{% endstep %}
{% endstepper %}

Click **Create data sink** when complete.&#x20;

Your new Data sink will appear in the **Data sinks** area list.

## Pipeline configuration

When it comes to using this Data sink in a [Pipeline](https://docs.onum.com/the-workspace/pipelines), you must configure the following output parameters. To do it, simply click the Data sink on the canvas and select **Configuration**.

### Output configuration

{% stepper %}
{% step %}
Choose the incoming **Event field**<mark style="color:red;">\*</mark> containing the event to be sent on.
{% endstep %}

{% step %}
**Path format**

Optionally, enter a static **prefix** for the file path.

Choose the frequency with which to generate a new Google Cloud Storage object using **Partition by**<mark style="color:red;">**\***</mark> or select **None** to ignore.
{% endstep %}

{% step %}
**File format**

Enter a static **prefix** and **suffix** for the outgoing file.
{% endstep %}
{% endstepper %}

Click **Save** to complete the process.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/data-sinks/data-sink-integrations/send-data-to-google-cloud-products/send-data-to-google-cloud-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
