This document explain how one can setup Google Cloud Platform to forward its cloud resource logs from a particular GCP project into Google Pubsub topic so that is available for Loki promtail to consume.
This document assumes, that reader have `gcloud` installed and have required permissions(as mentioned in #[Roles and Permission] section)
# Roles and Permission
## Roles and Permission
User should have following roles to complete the setup.
- "roles/pubsub.editor"
- "roles/logging.configWriter"
# Setup Pubsub Topic
## Setup Pubsub Topic
Google Pubsub Topic will act as the queue to persist log messages which then can be read from `promtail`.
```bash
@ -22,7 +26,8 @@ e.g:
$ gcloud pubsub topics create cloud-logs
```
# Setup Log Router
## Setup Log Router
We create a log sink to forward cloud logs into pubsub topic created before