[英]Can I configure GCP ops-agent to send logs to other project or publish logs to Pub/Sub topic?
The goal of this context is to achieve a centralized logs storage.此上下文的目标是实现集中式日志存储。 I want all of the logs across different projects to be stored under the same project.
我希望跨不同项目的所有日志都存储在同一个项目下。
By far of my experience on the ops-agent, it always sends logs to the corresponding project's log bucket.根据我在 ops-agent 上的经验,它总是将日志发送到相应项目的日志存储桶。 The ops-agent documentation neither provide manual on customizing the log destination.
ops-agent 文档既不提供自定义日志目标的手册。
I want to send the logs to a specified log bucket or Pub/Sub topic.我想将日志发送到指定的日志存储桶或 Pub/Sub 主题。 Is it achievable?
它可以实现吗?
I think that Log Sinks could help you to achieve what you want.我认为 Log Sinks 可以帮助你实现你想要的。 They are the mecanism to aggregate logs within and Organization.
它们是在组织内聚合日志的机制。
Here you can check and example where they do the same with audit logs.在这里,您可以检查并举例说明他们对审计日志执行相同操作的位置。
And here you can find the documentation of how to route logs using sinks. 在这里您可以找到有关如何使用接收器路由日志的文档。
With sinks you can use several destinations as Log buckets, PubSub, cloud Storage or BigQuery.借助接收器,您可以使用多个目标,如日志存储桶、PubSub、云存储或 BigQuery。
Hope this works for your use case.希望这适用于您的用例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.