(jsonPayload.causeCode="LOAD_BALANCER_HEALTH_CHECK_FIREWALL_HEALTH_CHECK_RANGE_BLOCKED" OR
jsonPayload.causeCode="LOAD_BALANCER_HEALTH_CHECK_FIREWALL_HEALTH_CHECK_FIREWALL_NOT_CONFIGURED"
)
[[["容易理解","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,["# Configure log-based alerts\n\nYou can use log-based alerts to notify you when Network Analyzer detects\nspecific insights. Examples for Network Analyzer insights include the following:\n\n- View all the insights on GKE cluster-related issues\n- View all high priority insights\n- View all load balancer firewall health check issues\n- View all insights in the region `us-central1`\n\nNetwork Analyzer logs are part of the Google Cloud platform logs. The log names\nare in the following format: \n\n```\nprojects/{project-id}/logs/networkanalyzer.googleapis.com%2Fanalyzer_reports\n```\n\nYou can find the log ID, monitored resource, and the payload proto details in\nthe [Network Analyzer logs API](/logging/docs/api/platform-logs#network_analyzer).\nBy default, the logs are routed to the [default log bucket](/logging/docs/routing/overview#default-bucket).\n\nTo get details about supported Cloud Logging insight types, see\n[Insight groups and types](/network-intelligence-center/docs/network-analyzer/insight-groups-types).\n\nCreate log queries\n------------------\n\nYou can use the Logging query language to query and filter\nCloud Logging data. For more information, see\n[Logging query language](/logging/docs/view/logging-query-language).\nFollowing are some examples of log queries for specific Network Analyzer insights:\n\n- **Example:** The following query returns the insights on all GKE\n cluster-related issues:\n\n ```\n LOG_ID(\"networkanalyzer.googleapis.com%2Fanalyzer_reports\")\n jsonPayload.resourceName=~\"^//container.googleapis.com/projects/.+/clusters/\"\n ```\n- **Example:** The following query returns all **high priority** insights:\n\n ```\n LOG_ID(\"networkanalyzer.googleapis.com%2Fanalyzer_reports\")\n jsonPayload.priority=\"HIGH\"\n ```\n- **Example:** The following query returns all insights that belong to either of\n the two specific **Load Balancer Health Check** insight types:\n\n ```\n (jsonPayload.causeCode=\"LOAD_BALANCER_HEALTH_CHECK_FIREWALL_HEALTH_CHECK_RANGE_BLOCKED\" OR\n jsonPayload.causeCode=\"LOAD_BALANCER_HEALTH_CHECK_FIREWALL_HEALTH_CHECK_FIREWALL_NOT_CONFIGURED\"\n )\n ```\n- **Example:** The following query returns all insights with location `us-central1`:\n\n ```\n LOG_ID(\"networkanalyzer.googleapis.com%2Fanalyzer_reports\")\n jsonPayload.location=\"us-central1\"\n ```\n- **Example:** The following query returns all insights that belong to the hybrid\n connectivity category:\n\n ```\n LOG_ID(\"networkanalyzer.googleapis.com%2Fanalyzer_reports\")\n jsonPayload.reportGroups=\"HYBRID_CONNECTIVITY\"\n ```\n\nSet up log-based alerts\n-----------------------\n\nYou can use the log queries to set up log-based alerts to notify you when the\nmatching insights are discovered by Network Analyzer. You can create\nlog-based alerts from the [Logs Explorer](/logging/docs/alerting/log-based-alerts#lba-definition)\nin the Google Cloud console or by using the [Cloud Monitoring API](/logging/docs/alerting/log-based-alerts#lba-by-api).\n\nConfigure log-based alerts for organizations, folders, and metrics scopes\n-------------------------------------------------------------------------\n\nTo route logs from multiple projects to a single destination project, see\n[Create a sink](/logging/docs/export/configure_export_v2#creating-sink).\nYou can then configure alerts in the destination project.\n\nExport logs to a third-party platform\n-------------------------------------\n\nYou can configure a customized log sink to export logs to Cloud Storage,\nBigQuery, Pub/Sub, and third-party platforms. For more information, see\n[Configure and manage sinks](/logging/docs/export/configure_export_v2).\n\nEnable or disable logging\n-------------------------\n\nTo enable the Cloud Logging API, see\n[Enable the Logging API](/logging/docs/api/enable-api).\nTo access the logs data in the [Logging API](/logging/docs/reference/v2/rest),\nthe [Logs Explorer](/logging/docs/view/logs-explorer-interface), and the\n[Google Cloud CLI](/logging/docs/reference/tools/gcloud-logging),\nyou must grant the required Identity and Access Management (IAM) roles and permissions. For more information, see\n[Access control with IAM](/logging/docs/access-control).\n\nTo disable Network Analyzer logs for a project, you can configure an\n[exclusion filter](/logging/docs/routing/overview#exclusions)\nto filter out Network Analyzer logs for the project."]]