Search code examples
google-cloud-platformgoogle-cloud-stackdriveraudit-logging

How can I transfer logs from Logs Viewer of GCP to Slack or email?


I have been exploring to transfer the JsonPayload message field from Logs viewer service (which are syslogs of a service) of GCP to a slack network, but owing to this I am not able to find any predefined services (like alerting policies to transfer Payload) available on Stackdriver. I have been able to create a counter or distribution user-metrics for logs but this will only provide me with some int64 value instead of a string value or the actual message body. Is there a way in GCP to actually send a payload of logs over slack or any email?


Solution

  • We had a similar issue where we wanted to be able to send certain events to slack and for fatal issues trigger an issue with our ops team via VictorOps.

    Couldn't find anything out there to fit our needs so we just created our own slack / VictorOps Cloudfunction.

    https://github.com/patiently/gcloud-slack-logger