问题
I have set up Stackdriver logging agents on Google Compute Engine VMs, and collecting logs from apache and some other sources. Is it possible to trigger a notification when a http 500 log is produced?
If parsing textPayload for notification is not an option, can it be done by modifying the fluentid configs to send in a specific label when it uploads a matching log?
回答1:
I think that a logging metric is your best bet. https://cloud.google.com/logging/docs/logs-based-metrics/charts-and-alerts#creating_a_simple_alerting_policy_on_a_counter_metric
来源:https://stackoverflow.com/questions/47080801/is-it-possible-to-trigger-notification-e-g-for-http-500-from-stackdriver-log