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

1

8

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): The Webhook API has received

Here is what I want: enter image description here

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

Thank so much

Embowel answered 24/12, 2021 at 10:36 Comment(2)
hi, have you seen the Managing notifications channel documentation? It's also worth to check Error Reporting manage notifications documentation.Setiform
Trying to figure this out myself. So I notice textPayload might be the variable we want to output. Then you can include variables in the notificationMonoplane
A
4

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.

Antrum answered 18/8, 2022 at 22:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.