google cloud platform – How do you change the log scope of a log sink?

Indeed, you can’t create a sink from a log scope. But I think it’s a feature, not a bug. A scope is set of log view across different project, to be able to have a single view in a single place of all your logs. There is no physical storage, routing or processing, it’s just a view.

The log sink is a processing component that route the logs entry. You can have a look to the documentation here and watch the video; and you can see this diagram

enter image description here

In fact, the log sink is not based on a log bucket or whatever, it’s directly connected to the Cloud Logging API to route the log entries to the correct destination. Because of this, you must plug your sink (or router) directly at the root of Cloud logging and not as a sub processing of a previous sink.

If you need to get logs from multiple project, you can :

  • either create a sink in each project that sink in the same PubSub message
  • or create a sink at a folder/org level and set the correct filter, and sink the result to PubSub.

Read more here: Source link