쿼리 결과 창의 헤더에서 알림 만들기를 클릭합니다. 창이 너무 좁으면 작업 메뉴에 알림 만들기 옵션이 대신 표시됩니다.
알림 세부정보 창에서 알림 이름과 설명을 지정합니다.
알림 정책 이름 필드에 알림 이름을 입력합니다. 이 이름은 알림 헤더에 표시됩니다.
문서 필드에 알림에 대한 설명을 입력합니다. 이 필드의 콘텐츠 형식 지정 및 세부 조정 방법에 대한 자세한 내용은 문서 템플릿에서 마크다운 및 변수 사용을 참고하세요. 문서 필드에 관리 콘솔의 URL을 포함하는 것이 좋습니다. 문제를 해결하는 해결 방법을 추가할 수도 있습니다.
다음을 클릭합니다.
알림에 포함할 로그 선택 창에서 다음을 수행합니다.
로그 미리보기를 클릭하여 쿼리와 결과를 확인합니다. 필요한 경우 이 창에서 쿼리를 수정할 수도 있습니다.
라벨을 추가하여 알림을 맞춤설정하고 더 많은 정보를 제공할 수 있습니다. 라벨 추가를 클릭하고 다음을 수행합니다.
라벨의 표시 이름을 입력합니다.
목록에서 로그 필드 이름을 선택합니다. 이 필드는 선택한 쿼리 결과를 기반으로 표시됩니다.
정규 표현식을 입력하여 정규 표현식 그룹이 정확히 1개 포함되어야 하는 필드에서 값을 추출합니다.
다음을 클릭합니다.
알림 사이의 최소 시간을 선택합니다. 이 값을 사용하면 알림이 여러 번 트리거될 때 이 알림으로부터 받는 알림 수를 컨트롤할 수 있습니다. 예를 들어 옵션에서 5분을 선택하여 알림을 5분마다로 제한할 수 있습니다. 해당하는 경우 메뉴에서 옵션을 선택하여 이슈 자동 종료 기간을 조정할 수 있습니다.
다음을 클릭합니다.
알림을 받을 알림 채널을 하나 이상 선택합니다(예: 이메일 알림 채널 선택).
이메일 알림 채널이 이미 구성되어 있으면 목록에서 선택할 수 있습니다. 그렇지 않으면 알림 채널 관리를 클릭하고 이메일 채널을 추가합니다. 알림 채널 만들기에 대한 자세한 내용은 알림 채널 관리를 참고하세요.
PROJECT_ID 변수를 프로젝트 ID로 변경하여 다음 로그 항목을 구성합니다. 알림 정책에 특정 이벤트 ID가 포함되거나 제외되는 경우 이벤트 ID도 수정해야 합니다.
"entries":[{"jsonPayload":{"eventId":10046,"errorMessage":"this is a manually generated error message created for testing"},"resource":{"type":"backupdr.googleapis.com/BackupRecoveryAppliance",},"severity":"ERROR","logName":"projects/PROJECT_ID/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events",}]
이전에 구성한 로그 항목을 복사합니다.
API 사용해 보기 창에서 다음 단계를 따르세요.
API 탐색기의 요청 본문 필드에 있는 콘텐츠를 이전 단계에서 복사한 로그 항목으로 바꿉니다.
실행을 클릭합니다. 메시지가 표시되면 인증 과정을 수행합니다.
logEntries.write 호출이 성공하면 HTTP 200 응답 코드와 빈 응답 본문 {}이 반환됩니다. API 탐색기에 관한 자세한 내용은 API 탐색기 사용을 참고하세요. API 탐색기는 Logging API와 동일한 방식으로 작동합니다.
로그 항목은 다음과 같은 방법으로 알림에 지정된 필터와 일치합니다.
logName 값은 Cloud 프로젝트의 백업/복구 어플라이언스 이벤트 로그인을 지정합니다.
이 로그 항목의 심각도 값은 ERROR입니다.
jsonPayload에 10046 풀 전체 이벤트가 포함되어 있습니다.
로그 항목을 작성하면 다음과 같은 시퀀스가 발생합니다.
새 로그 항목이 '로그 탐색기'에 표시되고 알림을 트리거합니다.
Cloud Monitoring에서 이슈가 열립니다.
해당 이슈에 대한 알림을 받습니다. 이메일 알림 채널을 구성한 경우 알림이 표시됩니다.
이메일에서 이슈 보기를 클릭하여 Cloud Monitoring에서 이슈를 볼 수 있습니다. 확인 및 종료 방법을 비롯한 이슈에 관한 자세한 내용은 로그 기반 알림의 이슈 관리를 참고하세요.
여러 알림 정책 만들기
이벤트의 우선순위와 긴급도에 따라 알림 정책을 만드는 것이 좋습니다.
알림 관점에서 이벤트는 크게 다음과 같은 카테고리로 분류할 수 있습니다.
긴급하게 처리해야 하며 따라서 더 자주 알림을 받아야 하는 이벤트입니다. 예를 들어 이벤트 ID 43901 (스냅샷 작업 실패)은 30분마다 보고해야 합니다. 다음 쿼리를 사용하여 알림을 만듭니다.
Policyname='Snapshot job has failed'Notificationratelimit=30minlogName="projects/PROJECT_ID/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events"ANDjsonPayload.eventId=43901
긴급도가 낮아 알림 빈도가 낮은 이벤트입니다. 예를 들어 이벤트 ID 10085 (백업 계획 위반)는 하루에 한 번만 보고하면 됩니다. 다음 쿼리를 사용하여 알림을 만듭니다.
Policyname='Backup Plan Violation has occurred'Notificationratelimit=1daylogName="projects/PROJECT_ID/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events"ANDjsonPayload.eventId=10085
영향을 미치지 않으며 무시할 수 있는 이벤트입니다. 예를 들어 이벤트 ID 10229 (저장용량 초과 오류) 및 42356 (파일 변경사항이 감지됨)은 Google 지원팀에서 거짓양성이라고 선언했으므로 무시할 수 있습니다. 다음 쿼리를 사용하여 알림을 만듭니다.
Policyname='Backup/DR event has occurred'Notificationratelimit=6hrlogName="projects/PROJECT_ID/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events"ANDNOTjsonPayload.eventId=(10085OR10229OR42356OR43901)
[[["이해하기 쉬움","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(UTC)"],[[["\u003cp\u003eThis guide outlines the process of configuring log-based alerts for the Backup and DR Service using the Logs Explorer in the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eCreating an alert involves specifying the alert name and description, selecting the logs to monitor, setting notification frequency and incident auto-closure times, and choosing notification channels.\u003c/p\u003e\n"],["\u003cp\u003eTo set up log-based alerts, users need the correct Identity and Access Management (IAM) permissions and must have or create a notification channel to receive alerts.\u003c/p\u003e\n"],["\u003cp\u003eYou can define custom labels for your alerts to extract specific data from log events and make your alerts more informative.\u003c/p\u003e\n"],["\u003cp\u003eLog-based alert policies can be tailored to different event priorities and urgencies, allowing for varied notification frequencies for events like failed snapshots, backup plan violations, or non-impacting issues.\u003c/p\u003e\n"]]],[],null,["# Configure a log-based alert\n\nThis page explains how to configure a log-based alert from the **Log Explorer** for the\nBackup and DR Service in the Google Cloud console.\n\nThe **Logs Explorer** interface for creating and editing log-based alerts guides you through the following steps:\n\n- Provide a name and description for the alert.\n- Choose the logs for which you want to receive a notification.\n- Set the time between notifications.\n- Set the time for automatic closure of incidents.\n- Specify whom to notify.\n\nPermissions and roles\n---------------------\n\nTo create and manage log-based alerts, your **Identity and Access Management (IAM)** role\nmust include the permissions described in [Permissions for log-based alerts](/logging/docs/access-control#lba-permissions).\n\nCreate a log-based alert\n------------------------\n\nTo notify an alert, you need to have a\n[notification channel](/monitoring/support/notification-options). You can create the\n[notification channel](/monitoring/support/notification-options) before creating\nan alert or while creating an alert.\n\nTo create a log-based alert, follow these steps:\n\n1. In the Google Cloud console, select **Logging** and then **Logs Explorer**.\n2. Use the **Query** pane to define the event on which you want to be notified. You can use the query examples shown in [sample queries](/backup-disaster-recovery/docs/configuration/appliance-events#log) in the query pane to configure alerts.\n\n The following is the sample query to get notified on an event with a specific event ID. \n\n logName=\"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events\"\n jsonPayload.eventId=10046\n\n3. In the header of the **Query results** pane, click **Create alert** . If your window is too narrow, the **Create alert** option appears on the **Actions** menu instead.\n\n4. In the **Alert details** pane, give the alert a name and description:\n\n 1. Enter a name for your alert in the **Alert Policy Name** field. This name gets displayed in the notification header.\n 2. In the **Documentation** field, enter the description for the alert. For information about how you can format and refine the content of this field, see [Using Markdown and variables in documentation templates](https://cloud.google.com/monitoring/alerts/doc-variables). We suggest you include the URL of the management console in the documentation field. You can also add the workaround to resolve the event.\n5. Click **Next**.\n\n6. In the **Choose logs to include in the alert** pane, do the following:\n\n 1. Check the query and results by clicking **Preview logs**. You can also edit the query in this pane, if necessary.\n 2. You can add [labels](/monitoring/alerts/labels) to customize notifications\n and make them more informative. Click **Add a label** and do the following:\n\n 1. Entry a **Display name** for the label.\n 2. Select **Log field name** from the list. These fields are displayed based on the selected query result.\n 3. Enter **Regular expression** to extract a value from the field that must contain exactly one regular expression group.\n7. Click **Next**.\n\n8. Select the minimum time between notifications. This value lets you control the number of notifications you get from this alert if it is triggered multiple times. For example, you can select **5 min** from the options to limit the notifications to every five minutes. You can adjust the incident autoclose duration by selecting an option on the menu if applicable.\n\n9. Click **Next**.\n\n10. Select one or more notification channels for your alert, for example, select an email notification channel.\n If you already have an email notification channel configured, then you can select it from the list. If not, click **Manage notification channels** and add an email channel. For information about creating notification channels, see [Manage notification channels](/monitoring/support/notification-options).\n\n11. Click **Save**.\n\n We recommend you to configure alerts for important [*Event IDs*](/backup-disaster-recovery/docs/event-codes).\n\nTest the log-based alert\n------------------------\n\nTo test the log-based alert you created, you can manually write a log entry that matches\nthe query. To write the log entry, follow these steps:\n\n1. Go to the [`logEntries.write`](/logging/docs/reference/v2/rest/v2/entries/write) reference page, or click\n the following button:\n\n [Go to logEntries.write](/logging/docs/reference/v2/rest/v2/entries/write)\n2. Configure the following log entry by changing the \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\n variable to your project ID. If your alert policy includes or excludes specific\n event IDs then you need to modify the event ID as well:\n\n \"entries\": [\n {\n \"jsonPayload\": {\n \"eventId\": 10046,\n \"errorMessage\": \"this is a manually generated error message created for testing\"\n },\n \"resource\": {\n \"type\": \"backupdr.googleapis.com/BackupRecoveryAppliance\",\n },\n \"severity\": \"ERROR\",\n \"logName\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events\",\n }\n ]\n\n3. Copy the log entry you configured previously.\n\n4. In the **Try this API** pane, follow these steps:\n\n 1. Replace the content in the **Request body** field in **APIs Explorer** with the log entry you copied in the previous step.\n 2. Click **Execute**. If prompted, follow the authentication flow.\n\n If the logEntries.write call is successful, then you get an HTTP 200 response code and an empty response body, {}. For more information about **APIs Explorer** , see [Using the APIs Explorer](/monitoring/api/apis-explorer), The **APIs Explorer** works the same way with the **Logging API**.\n\n The log entry matches the filter specified for the alert in the following ways:\n - The logName value specifies the backup/recovery appliance event sign in for your Cloud project.\n - The severity value for this log entry is ERROR.\n - The jsonPayload contains a 10046 pool full event.\n\n After you write the log entry, the following sequence occurs:\n 1. The new log entry appears in the \"Logs Explorer and triggers the alert.\n 2. An incident is opened in Cloud Monitoring.\n 3. You receive a notification for the incident. If you configured an email notification channel, then the notification displays.\n\nYou can click **View incident** in the email to see the incident in\n**Cloud Monitoring** . For more information about incidents including how to\nacknowledge and close them, see [Manage incidents for log-based alerts](/logging/docs/alerting/log-based-incidents).\n\nCreate multiple alert policies\n------------------------------\n\nYou may want to create alert policies based on the priority and urgency of events.\nFrom alerting perspective, events can be broadly categorized into the following categories:\n\n1. Events that are required to be attended urgently and hence require more\n frequent notifications. For example, the event ID 43901 (failed snapshot job) needs to be reported every 30 minutes. Use the following query to create the alert.\n\n Policyname = 'Snapshot job has failed'\n Notification rate limit = 30 min\n logName=\"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events\" AND jsonPayload.eventId=43901\n\n2. Events that are less urgent and hence require less frequent notifications. For example, the event ID 10085 (backup plan violations) need to only be reported once per day. Use the following query to create the alert.\n\n Policyname = 'Backup Plan Violation has occurred'\n Notification rate limit = 1 day\n logName=\"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events\" AND jsonPayload.eventId=10085\n\n3. Events that are non-impacting and can be ignored. For example, the event IDs 10229 (exceeded storage errors) and 42356 (file changes have been detected) can be ignored, as Google support have declared they are false positives. Use the following query to create the alert.\n\n Policyname = 'Backup/DR event has occurred'\n Notification rate limit = 6 hr\n logName=\"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/backupdr.googleapis.com%2Fbackup_recovery_appliance_events\" AND NOT jsonPayload.eventId=(10085 OR 10229 OR 42356 OR 43901)"]]