简体   繁体   中英

Google Cloud logs: How to send error logs details to another channel like slack, email, or webhook API?

I want to send the error logs/warning logs automatically from GCP into slack, email, or Webhook API.

Now I am using Google Cloud/Monitoring/Alerting -> create a policy. But it only sends the payload information, not including the error logs details that I want.

Here is What I received via webhook API (Payload information): Webhook API 已收到

Here is what I want: 在此处输入图像描述

I hope someone can help me to find the solutions or ideas on this issue.

Thank so much

I followed the instructions in the "Enabling Slack" section, here , and was able to successfully enable the Slack/Google Cloud Monitoring integration.

I was then able to create an alert policy and send the alerts to the slack channel listed in step 4.3.

Alternatively, you can search for logs via the Log Explorer and create an alert via the "Create alert" button beneath the query .

This document will show you how to edit the info listed in the Slack message by editing the "Documentation" field of your alert, within the "Alert details" section.

Unfortunately, I've not yet figured out how to include any info from the actual log within the Slack message triggered by the alert - the message does auto-hyperlink to the error, though.

First post - sorry for the formatting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM