---
title: "GCP logs: Alloy + Pub/Sub | Grafana Labs"
description: "Collect GCP logs using Grafana Alloy with Pub/Sub."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

## How it works

**Complexity:** Moderate | **Infrastructure:** Pub/Sub + Alloy | **Latency:** Streaming

[GCP logs collection pipeline](gcp-logs-pipeline.svg "GCP logs collection pipeline")

You create a log sink in Cloud Logging with filters that select which logs to export. The sink routes them to a Pub/Sub topic. Alloy subscribes to the topic, processes the logs, and forwards them to Grafana Cloud Logs. Sink filters let you reduce volume at the source.

## Considerations

- Reliable Pub/Sub message delivery
- Log sink filtering to reduce volume
- Workload identity authentication
- Full processing pipeline
- Alloy infrastructure to deploy, maintain, and update
- Pub/Sub cost, plus setup steps

## Documentation

View the [GCP logs](/docs/grafana-cloud/monitor-infrastructure/monitor-cloud-provider/gcp/config-gcp-logs/) documentation.
