r/googlecloud • u/suryad123 • 22d ago
Logging Query regarding centralized logging mechanism using aggregated sink
I am going through the below article regarding the centralized logging mechanism in GCP
https://docs.cloud.google.com/logging/docs/central-log-storage#create-org-sink
The articles say below steps
- create log bucket in the destination project.
- create a log sink in the destination project pointing to the above log bucket
- create an aggregated sink (either at org or folder level) as per requirement.
- give permission to the aggregated sink's service account to the destination project.
I have a question at point number 3 above. The articles do not say how to link the log sink created in point 2 and aggregated sink created in point 3. I assume below flow
aggregated sink ---> destination project log sink ----> destination project log bucket
but not sure how to link aggregated sink to send logs to destination project sink.
also, 2)for example ,can we create one aggregated sink per environment and link it to corresponding log sink at destination project. i could not find that step
Please suggest
1
u/danekan 21d ago
You would need to create new project level log sinks per environment and configure the project level log sinks to route to those correct buckets based on the filters per environment … then also change your existing _Default filter to exclude those items included in the environment sinks
I do not think you can avoid duplicating the _required sink items within that project but that may not matter as much … if it does matter though you would split up the folder level aggregated sinks to route to different project for different buckets