Situation
Need Transfer System Log To GCP Logging
Install
curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh
sudo bash add-logging-agent-repo.sh --also-install
Restart Service, Check Service Status And Check Service Log
service google-fluentd restart
service google-fluentd status
tail /var/log/google-fluentd/google-fluentd.log
Using Proxy With google-fluentd
Edit /etc/default/google-fluentd
Add These
export http_proxy="http://proxy-ip:proxy-port"
export https_proxy="http://proxy-ip:proxy-port"
export no_proxy=169.254.169.254
Query Your Logging
resource.type="gce_instance"
resource.labels.instance_id="<instance-id"
logName="projects/<project-name>/logs/syslog"
"journal"
Ref - Google Cloud Doc