> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/content-collections/connect/connect-cloud-accounts/onboard-gcp/flow-logs-compression.md).

# Flow Logs Compression on GCP

Prisma Cloud enables you to automate the compression of flow logs using the Google Cloud Dataflow service.

Prisma Cloud recommends that you enable flow logs compression. This additional automation on Prisma cloud addresses the lack of native compression support for flow logs sink setup on GCP and helps reduce the egress costs associated with transferring large volume of logs to the Prisma Cloud infrastructure.

When you enable Dataflow compression on Prisma Cloud, the Dataflow pipeline resources are created in the same GCP project associated with the Google Cloud Storage bucket to which your VPC Flow logs are sent, and it saves the compressed logs also to the Cloud Storage bucket. Therefore, if you are onboarding a GCP Organization and enabling Dataflow compression to it or enabling Dataflow compression to an existing GCP Organization that has been added to Prisma cloud, make sure that the Dataflow-enabled Project ID is the same Google Cloud Storage bucket to which you send VPC flow logs.

If the Prisma Cloud service user responsible for the organization is created in a GCP project that is different from the project where the storage bucket for flow logs resides, the Dataflow API should be enabled on both projects so that dataflow compression can be triggered.

In order to launch the Dataflow job and create and stage the compressed files, the following permissions are required:

* Enable the dataflow\.googleapi.com Dataflow API.
* Grant the service account with permissions to:
  * Run and examine jobs — userinput:\[Dataflow Admin] role
  * [Attach](https://cloud.google.com/iam/docs/service-accounts-actas) service accounts to Dataflow resources — userinput:\[iam.serviceAccounts.actAs] permission
  * Create a network, subnetwork, and firewall rules within your VPC — userinput:\[compute.networks.create] , userinput:\[compute.subnetworks.create] , userinput:\[compute.firewalls.create] , userinput:\[compute.networks.updatepolicy]

    To enable connectivity with the Dataflow pipeline resources and the compute instances that perform log compression within your VPC, Prisma Cloud creates a network, subnetwork, and firewall rules in your VPC. You can view the compute instances that are spun up with the RQL userinput:\[config where api.name='gcloud-compute-instances-list' AND json.rule = name starts with "prisma-compress"]

For details on enabling the APIs, see [Service Account Permissions](/content-collections/connect/connect-cloud-accounts/onboard-gcp/prerequisites-to-onboard-gcp.md) and [GCP APIs](/content-collections/connect/connect-cloud-accounts/onboard-gcp/prerequisites-to-onboard-gcp.md).

The GCP Flow Logs compression test jobs are submitted to ensure that Prisma Cloud can verify flow log compression jobs for cloud accounts and to confirm that the Dataflow API is enabled. Prisma Cloud launches test jobs at regular intervals before submitting compression jobs and to:

* Verify that the compression is enabled for the GCP project.
* Verify that at least one Dataflow enabled child project is in an organization type account.
* Verify that the credentials are not empty.
* Verify that the project ID is not empty.
* Verify the region from storage location.
* Verify the network, subnet, and firewall.

After the above validations are done, the test job is submitted. If the submission is successful then the API returns a 200 status code indicating that everything needed for submission is available at the GCP project level. If a test job fails then it can be ignored.

If there was an error during the submission then the appropriate error messages would be logged; these entries indicate the cause of failure.

In addition, the Cloud Dataflow service spins up short lived compute instances to handle the compression jobs and you may have associated costs with the service. Prisma Cloud recommends keeping your Cloud Storage bucket in the same project in which you have enabled the Dataflow service. Based on the location of your Cloud Storage bucket, Prisma Cloud launches the Cloud Dataflow jobs in the following regions:

| Storage Bucket Region                                                                                                         | Region Where the Dataflow is Launched                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| <p>us-central1</p><p>us-east1</p><p>us-west1</p><p>europe-west1</p><p>europe-west4</p><p>asia-east1</p><p>asia-northeast1</p> | <p>us-central1</p><p>us-east1</p><p>us-west1</p><p>europe-west1</p><p>europe-west4</p><p>asia-east1</p><p>asia-northeast1</p> |
| <p>eur4</p><p>oreu</p>                                                                                                        | europe-west4                                                                                                                  |
| asia                                                                                                                          | asia-east1                                                                                                                    |
| us                                                                                                                            | <p>us-central1</p><p>orus-east1</p>                                                                                           |
| Any other region                                                                                                              | us-central1                                                                                                                   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.prismacloud.io/content-collections/connect/connect-cloud-accounts/onboard-gcp/flow-logs-compression.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
