How to customize the email body additional details of authentication info, error logs using Log based alerts in GCP

30 views Asked by At

I configured log based alerts to trigger set of notifications on specific error log entry in Cloud logging. requirment: Email notification contains just the Project, resource & unique iD and timestamp but there is no details about the authentication info like who did the changes & what is the Error log entry .. There us no option to customize those details in documentation section under ALERT policy.

Anyone achieved this ?

I got another approach to get this details as follow Create a cloud function Create a pubsub topic create a Log sink with expected log filter which will dump the logs into logsink linked to pubsub topic which will notify the cloud function and trigger notification..

but this loooks like over engineering for me..this also involved 3rd party email app like Sendgrid email api to cloud function inorder to trigger such emails

Any other easy way in GCP to achieve my requirement.. Very much appreciated!

tried log based alerting mechanism need advice on how to include user & error log details in mail body

0

There are 0 answers