While GCP allows event arc execution, or trigger for a number of different services\methods\log types, is there any way to execute based on text output in the logs.
Eg. can an eventarc trigger be created to executed on an error, with a certain error message protoPayload.serviceData.jobCompletedEvent.job.jobStatus.additionalErrors.message='Failed due to value 0'
GCP Eventarc for specific log entry
234 views Asked by RaptorX At
1
From what I understand -- you are trying to invoke some custom logic based on the generation of a certain error message.
While directly -- you cannot have an EventArc Trigger for a custom payload, there is one way that you can do that:
Cloud Pub/Sub topic
. This is important.Check out this excellent blog post that highlights various ways to configure EventArc filters.
Note: The above is required if you want to go to the EventArc way. From the Log-based Alerts, you can directly just write it to a Pub/Sub topic or even a custom Webhook and you wouldn't need to route it via the EventArc service.