Resolver problemas com políticas de alertas com base em registros
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Neste documento, você encontra informações para solucionar problemas ao usar políticas de alertas com base em registros.
Nenhum registro correspondente disponível
Quando você testa seu filtro para uma política de alertas com base em registro, nenhum registro é retornado.
Verifique os seguintes erros comuns:
Você está tentando filtrar registros excluídos. As políticas de alertas com base em registros operam apenas em registros incluídos.
Você está tentando filtrar por buckets de registro ou por outros recursos do Google Cloud, como organizações ou contas do Cloud Billing. Google Cloud
As políticas de alertas com base em registros operam no nível do projeto Google Cloud .
Sua consulta é muito restritiva. Verifique se os nomes dos campos e as expressões regulares estão corretos. Use o painel Consulta no Explorador de registros ou o botão Visualizar registros na interface de configuração de alertas para validar a consulta. Para mais informações sobre como criar consultas, acesse
Linguagem de consulta do Logging.
A política de alertas não está funcionando
Você criou uma política de alertas com base em registros, mas ela não está funcionando como esperado. Exemplo:
O Cloud Monitoring não está enviando notificações para a política de alertas.
Se a política de alertas extrair rótulos, verifique se ela não está extraindo o rótulo timestamp. A extração desse rótulo impede que a política de alertas crie incidentes e envie notificações.
Se você parou de receber notificações, talvez tenha atingido o limite de taxa de 20 incidentes por dia para cada política de alertas com base em registros. Verifique a notificação mais recente que você recebeu para essa política de alertas com base em registro e procure uma instrução de que o limite de incidentes foi excedido para o dia.
Se você não estiver recebendo quantas notificações espera, verifique a configuração da política de alertas com base em registros. Talvez seja necessário ajustar o valor do tempo entre as notificações.
O Cloud Monitoring não está criando incidentes quando as condições da política são atendidas.
Se a política de alertas extrair rótulos, verifique se ela não está extraindo o rótulo timestamp. A extração desse rótulo impede que a política de alertas crie incidentes e envie notificações.
Acesse a página Incidentes no Cloud Monitoring e filtre a tabela por nome da política. Os resultados mostram os alertas atuais e anteriores:
Se não houver incidentes, verifique se a consulta usada está encontrando registros
correspondentes. Verifique se os nomes dos campos e as expressões regulares estão corretos. Use o painel Consulta no Explorador de registros ou o botão Visualizar registros na interface de configuração de alertas para validar a consulta. Para mais informações sobre como criar consultas, acesse
Linguagem de consulta do Logging.
Se houver incidentes anteriores, mas nenhum recente no dia atual, você pode ter atingido o limite de 20 incidentes por dia para cada política de alertas com base em registros.
Verifique a notificação mais recente que você recebeu para essa política de
alerta e procure uma instrução informando que o limite de incidentes foi
excedido para o dia.
O Cloud Monitoring cria incidentes para mais entradas de registro do que o esperado:
É possível que sua consulta de registro não seja suficientemente restritiva.
Verifique se os nomes dos campos e as expressões regulares estão corretos. Use o painel Consulta no Explorador de registros ou o botão Visualizar registros na interface de configuração de alertas para validar a consulta. Para mais informações sobre como criar consultas, acesse
Linguagem de consulta do Logging.
Os incidentes não estão fechando
Se você não fechar um incidente, o Cloud Logging vai fazer isso após o período de fechamento automático da política de alertas.
A duração padrão do fechamento automático é de 7 dias, mas você pode definir qualquer valor entre 30 minutos e 7 dias. Você também pode fechar incidentes manualmente a qualquer momento, conforme descrito em Como fechar incidentes.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-05 UTC."],[],[],null,["# Troubleshoot log-based alerting policies\n\n\u003cbr /\u003e\n\nThis document provides troubleshooting information for using log-based alerting\npolicies.\n\nNo matching logs are available\n------------------------------\n\nWhen you test your filter for a log-based alerting policy, no logs are returned.\nCheck the following common errors:\n\n- You are trying to filter on excluded logs. Log-based alerting policies operate\n only on included logs.\n\n- You are trying to filter by log buckets, or for other Google Cloud\n resources such as Cloud Billing accounts or organizations.\n Log-based alerting policies operate at Google Cloud project level.\n\n- Your query is too restrictive. Check that your field names and regular\n expressions are correct. You can use the **Query** pane in Logs Explorer\n or the **Preview logs** button in the alert-configuration interface to\n help validate the query. For information about creating queries, see\n [Logging query language](/logging/docs/view/logging-query-language).\n\nAlerting policy isn't working\n-----------------------------\n\nYou've created a log-based alerting policy, but it isn't working as you\nexpected. For example:\n\n- Cloud Monitoring isn't sending notifications for the alerting policy.\n\n If your alerting policy extracts labels, then verify that it isn't\n extracting the `timestamp` label. Extraction of this label prevents the\n alerting policy from creating incidents and sending notifications.\n\n If you've stopped receiving notifications, then you might have reached\n the rate limit of 20 incidents a day for each log-based alerting policy. Check the most recent\n notification you received for this log-based alerting policy and look for a\n statement that the incident limit has been exceeded for the day.\n\n If you aren't receiving as many notifications as you expect, then check\n the configuration of the log-based alerting policy. You might need to adjust\n the value for time between notifications.\n- Cloud Monitoring isn't creating incidents when policy conditions are\n met.\n\n If your alerting policy extracts labels, then verify that it isn't\n extracting the `timestamp` label. Extraction of this label prevents the\n alerting policy from creating incidents and sending notifications.\n\n Go to the **Incidents** page in Cloud Monitoring and filter the\n table by policy name. The results show the current and past alerts:\n - If there are no incidents, then verify that the query used is\n finding matching logs. Check that your field names and regular\n expressions are correct. You can use the **Query** pane in Logs Explorer\n or the **Preview logs** button in the alert-configuration interface to\n help validate the query. For information about creating queries, see\n [Logging query language](/logging/docs/view/logging-query-language).\n\n - If there are past incidents but no recent ones for the current day,\n then you might have reached the limit of 20 incidents a day for each log-based alerting policy.\n Check the most recent notification you received for this alerting\n policy and look for a statement that the incident limit has been\n exceeded for the day.\n\n- Cloud Monitoring creates incidents for more log entries than you\n expected:\n\n It's possible that your log query is insufficiently restrictive.\n Check that your field names and regular\n expressions are correct. You can use the **Query** pane in Logs Explorer\n or the **Preview logs** button in the alert-configuration interface to\n help validate the query. For information about creating queries, see\n [Logging query language](/logging/docs/view/logging-query-language).\n\nIncidents aren't closing\n------------------------\n\nIf you don't close an incident, then Cloud Logging closes the\nincident after the autoclose duration for the alerting policy has passed.\nThe default autoclose duration is 7 days, but you can set\nit to any value between 30 minutes and\n7 days. You can also manually close incidents at\nany time, as described in [Closing incidents](/logging/docs/alerting/log-based-incidents#closing)."]]