【发布时间】:2021-07-16 17:38:56
【问题描述】:
我在 Google Cloud Platform 的一个虚拟机中安装了 Apache2。我安装了Ops Agent 并将其配置如下per the docs:
logging:
receivers:
mywebserver:
type: files
include_paths:
- /var/log/apache*/access_log
- /var/log/apache*/error_log
service:
pipelines:
default_pipeline:
receivers:
- mywebserver
但是 GCP 中的日志没有显示此网络服务器的日志。即使对于此 VM 实例,我也没有在日志下拉列表中看到服务 mywebserver 作为过滤器选项。
操作系统:Ubuntu 18.x LTS
Ops Agent 版本:今天最新
我错过了什么?非常感谢您的帮助。
【问题讨论】:
-
你通过troubleshooting docs了吗?一个简单的代理重启可能会成功....
-
1) 您为虚拟机的访问范围设置了什么? 2) SSH 进入 VM 并在此处查看错误消息:/var/log/google-cloud-ops-agent/subagents/*.log
-
还要检查附加到您的 VM 的服务帐户,如果您使用的是默认 SA,那么编辑器应该没问题。如果您使用自己的 SA,请确保选择编辑器或监控管理员。
标签: google-cloud-platform apache2 google-cloud-stackdriver google-cloud-logging google-cloud-ops-agent