labels."servicehealth.googleapis.com/new_event"=trueANDjsonPayload.detailedCategory=\"CONFIRMED_INCIDENT\" AND jsonPayload.impactedProductIds =~ \"hV87iK5DcEXKgWU2kDri\" AND jsonPayload.@type = \"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\"
labels."servicehealth.googleapis.com/new_event"=trueANDjsonPayload.detailedCategory=\"CONFIRMED_INCIDENT\" AND jsonPayload.impactedLocations =~ \"us-central1\" AND jsonPayload.@type = \"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\"
labels."servicehealth.googleapis.com/new_event"=trueANDjsonPayload.detailedCategory=\"EMERGING_INCIDENT\" AND jsonPayload.impactedProductIds =~ \"ix7u9beT8ivBdjApTif3\" AND jsonPayload.@type = \"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\"
針對事件的任何更新或變更發出快訊
將 ALERT_CONDITION 設為下列值:
jsonPayload.detailedCategory=\"CONFIRMED_INCIDENT\" AND jsonPayload.@type = \"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\"
在確認的事件有任何更新時發出快訊
將 ALERT_CONDITION 設為下列值:
jsonPayload.state=~\"ACTIVE\" AND jsonPayload.detailedCategory = \"CONFIRMED_INCIDENT\" AND jsonPayload.detailedState != \"EMERGING\" AND jsonPayload.@type = \"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\"
狀態或相關性更新的快訊
將 ALERT_CONDITION 設為下列值:
jsonPayload.detailedCategory=\"CONFIRMED_INCIDENT\" AND "labels.servicehealth.googleapis.com/updated_fields" =~ \"'state'\" OR labels."servicehealth.googleapis.com/updated_fields" =~ \"'relevance'\" AND jsonPayload.@type = \"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\"
顯示完整事件詳細資料的快訊通知
以下快訊通知提供事件的完整詳細資料。
{"displayName":"ALERT_NAME","combiner":"OR","conditions":[{"displayName":"Log match condition","conditionMatchedLog":{"filter":"ALERT_CONDITION","labelExtractors":{"description":"EXTRACT(jsonPayload.description)","impactedLocations":"EXTRACT(jsonPayload.impactedLocations)","impactedProducts":"EXTRACT(jsonPayload.impactedProducts)","startTime":"EXTRACT(jsonPayload.startTime)","state":"EXTRACT(jsonPayload.state)","detailedState":"EXTRACT(jsonPayload.detailedState)"}}}],"documentation":{"content":"# View details at [Service Health dashboard](https://console.cloud.google.com/servicehealth/incidentDetails/projects%2F${resource.labels.resource_container}%2Flocations%2F${resource.labels.location}%2Fevents%2F${resource.labels.event_id}?project=${resource.labels.resource_container}) \n## Description \n${log.extracted_label.description} \n## Impacted locations \n${log.extracted_label.impactedLocations} \n## Impacted products \n${log.extracted_label.impactedProducts} \n## Incident start time \n${log.extracted_label.startTime} \n## Event state \n${log.extracted_label.state} \n## Event detailed state \n ${log.extracted_label.detailedState}","mimeType":"text/markdown"},"notificationChannels":["NOTIFICATION_CHANNEL"],"enabled":true,"alertStrategy":{"notificationRateLimit":{"period":"300s"},"autoClose":"1800s"}}
範例中的 labelExtractors 和 content 欄位包含事件的所有可用資訊。
快訊通知,內含 Service Health 資訊主頁的連結
以下範例提供服務健康狀態資訊主頁的連結。
{"displayName":"ALERT_NAME","combiner":"OR","conditions":[{"displayName":"Log match condition","conditionMatchedLog":{"filter":"ALERT_CONDITION","labelExtractors":{"description":"EXTRACT(jsonPayload.description)","impactedLocations":"EXTRACT(jsonPayload.impactedLocations)","impactedProducts":"EXTRACT(jsonPayload.impactedProducts)","startTime":"EXTRACT(jsonPayload.startTime)","state":"EXTRACT(jsonPayload.state)","detailedState":"EXTRACT(jsonPayload.detailedState)"}}}],"documentation":{"content":"# View details at [Service Health dashboard](https://console.cloud.google.com/servicehealth/eventDetails/projects%2F${resource.labels.resource_container}%2Flocations%2F${resource.labels.location}%2Fevents%2F${resource.labels.event_id})","mimeType":"text/markdown"},"notificationChannels":["NOTIFICATION_CHANNEL"],"enabled":true,"alertStrategy":{"notificationRateLimit":{"period":"300s"},"autoClose":"1800s"}}
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["This document shows examples of alerting policies that customize the content of\nalert notifications.\n\nBefore you begin\n\nBe familiar with\n[setting up alerts for Personalized Service Health](/service-health/docs/configure-alerts-cloud-logging).\n\nSee the\n[Service Health log schema reference](/service-health/docs/reference/event-logs/rpc/google.cloud.servicehealth.logging.v1)\nfor the fields you can set in the alert notifications and conditions.\n\nExample alert conditions\n\nThe following sections show examples of fine-grained alert conditions that you\ncan use for Cloud Logging or Terraform.\n| **Note:** Set the version of the Service Health logs in your alert condition. The current version is `type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog. `\n\nAlert on a new incident for a specific Google Cloud product\n\nSet \u003cvar class=\"readonly\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e to the following: \n\n labels.\"servicehealth.googleapis.com/new_event\"=true AND jsonPayload.detailedCategory = \\\"CONFIRMED_INCIDENT\\\" AND jsonPayload.impactedProductIds =~ \\\"hV87iK5DcEXKgWU2kDri\\\" AND jsonPayload.@type = \\\"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\\\"\n\nThe product name is in the common Google Cloud format. See\n[Google Cloud Service Health](https://status.cloud.google.com) for an example\nof the format.\n\nAlert on a new incident for a specific region\n\nSet \u003cvar class=\"readonly\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e to the following: \n\n labels.\"servicehealth.googleapis.com/new_event\"=true AND jsonPayload.detailedCategory = \\\"CONFIRMED_INCIDENT\\\" AND jsonPayload.impactedLocations =~ \\\"us-central1\\\" AND jsonPayload.@type = \\\"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\\\"\n\nThe location name is in the common Google Cloud format. See\n[Google Cloud Service Health](https://status.cloud.google.com) for an example\nof the format.\n\nAlert on a new emerging incident for a specific product\n\nSet \u003cvar class=\"readonly\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e to the following: \n\n labels.\"servicehealth.googleapis.com/new_event\"=true AND jsonPayload.detailedCategory = \\\"EMERGING_INCIDENT\\\" AND jsonPayload.impactedProductIds =~ \\\"ix7u9beT8ivBdjApTif3\\\" AND jsonPayload.@type = \\\"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\\\"\n\nAlert on any update or change to an incident\n\nSet \u003cvar class=\"readonly\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e to the following: \n\n jsonPayload.detailedCategory = \\\"CONFIRMED_INCIDENT\\\" AND jsonPayload.@type = \\\"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\\\"\n\nAlert on any update on confirmed incidents\n\nSet \u003cvar class=\"readonly\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e to the following: \n\n jsonPayload.state =~ \\\"ACTIVE\\\" AND jsonPayload.detailedCategory = \\\"CONFIRMED_INCIDENT\\\" AND jsonPayload.detailedState != \\\"EMERGING\\\" AND jsonPayload.@type = \\\"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\\\"\n\nAlert on state or relevance updates\n\nSet \u003cvar class=\"readonly\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e to the following: \n\n jsonPayload.detailedCategory = \\\"CONFIRMED_INCIDENT\\\" AND \"labels.servicehealth.googleapis.com/updated_fields\" =~ \\\"'state'\\\" OR labels.\"servicehealth.googleapis.com/updated_fields\" =~ \\\"'relevance'\\\" AND jsonPayload.@type = \\\"type.googleapis.com/google.cloud.servicehealth.logging.v1.EventLog\\\"\n\nAlert notification with full incident details\n\nThe following alert notification provides full incident details. \n\n {\n \"displayName\": \"\u003cvar scope=\"ALERT_NAME\" translate=\"no\"\u003eALERT_NAME\u003c/var\u003e\",\n \"combiner\": \"OR\",\n \"conditions\": [ {\n \"displayName\": \"Log match condition\",\n \"conditionMatchedLog\": {\n \"filter\": \"\u003cvar scope=\"ALERT_CONDITION\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e\",\n \"labelExtractors\": {\n \"description\": \"EXTRACT(jsonPayload.description)\",\n \"impactedLocations\": \"EXTRACT(jsonPayload.impactedLocations)\",\n \"impactedProducts\": \"EXTRACT(jsonPayload.impactedProducts)\",\n \"startTime\": \"EXTRACT(jsonPayload.startTime)\",\n \"state\": \"EXTRACT(jsonPayload.state)\",\n \"detailedState\": \"EXTRACT(jsonPayload.detailedState)\"\n } } } ],\n \"documentation\": {\n \"content\": \"# View details at [Service Health dashboard](https://console.cloud.google.com/servicehealth/incidentDetails/projects%2F${resource.labels.resource_container}%2Flocations%2F${resource.labels.location}%2Fevents%2F${resource.labels.event_id}?project=${resource.labels.resource_container}) \\n## Description \\n${log.extracted_label.description} \\n## Impacted locations \\n${log.extracted_label.impactedLocations} \\n## Impacted products \\n${log.extracted_label.impactedProducts} \\n## Incident start time \\n${log.extracted_label.startTime} \\n## Event state \\n${log.extracted_label.state} \\n## Event detailed state \\n ${log.extracted_label.detailedState}\",\n \"mimeType\": \"text/markdown\"\n },\n \"notificationChannels\": [ \"\u003cvar scope=\"NOTIFICATION_CHANNEL\" translate=\"no\"\u003eNOTIFICATION_CHANNEL\u003c/var\u003e\" ],\n \"enabled\": true,\n \"alertStrategy\": { \"notificationRateLimit\": { \"period\": \"300s\" }, \"autoClose\": \"1800s\" }\n }\n\nThe `labelExtractors` and `content` fields in the example include\nall information available for the incident.\n\nAlert notification with a link to the Service Health dashboard\n\nThe following example provides a link to the Service Health dashboard. \n\n {\n \"displayName\": \"\u003cvar scope=\"ALERT_NAME\" translate=\"no\"\u003eALERT_NAME\u003c/var\u003e\",\n \"combiner\": \"OR\",\n \"conditions\": [ {\n \"displayName\": \"Log match condition\",\n \"conditionMatchedLog\": {\n \"filter\": \"\u003cvar scope=\"ALERT_CONDITION\" translate=\"no\"\u003eALERT_CONDITION\u003c/var\u003e\",\n \"labelExtractors\": {\n \"description\": \"EXTRACT(jsonPayload.description)\",\n \"impactedLocations\": \"EXTRACT(jsonPayload.impactedLocations)\",\n \"impactedProducts\": \"EXTRACT(jsonPayload.impactedProducts)\",\n \"startTime\": \"EXTRACT(jsonPayload.startTime)\",\n \"state\": \"EXTRACT(jsonPayload.state)\",\n \"detailedState\": \"EXTRACT(jsonPayload.detailedState)\"\n } } } ],\n \"documentation\": {\n \"content\": \"# View details at [Service Health dashboard](https://console.cloud.google.com/servicehealth/eventDetails/projects%2F${resource.labels.resource_container}%2Flocations%2F${resource.labels.location}%2Fevents%2F${resource.labels.event_id})\",\n \"mimeType\": \"text/markdown\"\n },\n \"notificationChannels\": [ \"\u003cvar scope=\"NOTIFICATION_CHANNEL\" translate=\"no\"\u003eNOTIFICATION_CHANNEL\u003c/var\u003e\" ],\n \"enabled\": true,\n \"alertStrategy\": { \"notificationRateLimit\": { \"period\": \"300s\" }, \"autoClose\": \"1800s\" }\n }"]]