Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(gcplog): Add note on scraping multiple GCP projects #3430

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/sources/clients/promtail/gcplog-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ We need a service account with following permissions.

This enables promtail to read log entries from the pubsub subscription created before.

you can find example for promtail scrape config for `gcplog` [here](../scraping/#gcplog-scraping)

If you are scraping logs from multiple GCP projects, then this serviceaccount should have above permissions in all the projects you are tyring to scrape.

## Operations

Sometimes you may wish to clear the pending pubsub queue containing logs.
Expand All @@ -88,13 +92,13 @@ To delete all the old messages until now, set `--time` to current time.
gcloud pubsub subscriptions seek projects/my-project/subscriptions/cloud-logs --time=$(date +%Y-%m-%dT%H:%M:%S)
```

# Advanced log filter
## Advanced log filter

So far we've covered admitting GCS bucket logs into Loki, but often one may need to add multiple cloud resource logs and may also need to exclude unnecessary logs. The following is a more complex example.

We use the `log-filter` option to include logs and the `exclusion` option to exclude them.

## Use Case
### Use Case
Include following cloud resource logs
- GCS bucket
- Kubernetes
Expand Down