How do I coalesce Stackdriver logs/sinks into one BigQuery project/dataset?

眉间皱痕 提交于 2019-12-24 05:37:10

问题


Setting up Stackdriver log sinks to BigQuery is straightforward.

However, I have lots of projects, and instead of each export sink going to its corresponding project, I'd like to coalesce the logs from all my projects to one dedicated project.

The configuration in the Stackdriver sink config doesn't appear to let me select a different project to send the logs to.


How do I select a different project/dataset?


回答1:


You need to select the 'Custom destination' option. This will allow you to plug in a different project/dataset. The default datasets you see are always tied to whichever project you've currently got selected, so you can't select a different project/dataset.

Instead:

  1. Select 'Custom Destination'
  2. Add the destination using this format: bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]
  3. Give the sink writer editor permissions on the said project/dataset in step 2.

See more here.




回答2:


If all of your projects are under a Cloud Folder or under the same organization, you can also create an Aggregated Export as documented in https://cloud.google.com/logging/docs/export/aggregated_exports.

The aggregated sink lives in the folder or org, and exports all logs of children projects to the same destination.



来源:https://stackoverflow.com/questions/47464061/how-do-i-coalesce-stackdriver-logs-sinks-into-one-bigquery-project-dataset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!