From d4c7553a01ab699d44d1dd95f87b671a3d5eec1c Mon Sep 17 00:00:00 2001 From: James Herr Date: Wed, 23 Oct 2024 10:04:54 -0500 Subject: [PATCH] Moved TimeGenerated --- operations/template/alert.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/operations/template/alert.tf b/operations/template/alert.tf index a6c99b505..3d3316c47 100644 --- a/operations/template/alert.tf +++ b/operations/template/alert.tf @@ -137,10 +137,10 @@ resource "azurerm_monitor_scheduled_query_rules_alert" "ti-log-errors-alert" { query = <<-QUERY AppServiceConsoleLogs + | where TimeGenerated >= ago(30m) + and TimeGenerated <= now() | project JsonResult = parse_json(ResultDescription) | evaluate bag_unpack(JsonResult) | where level == 'ERROR' - and TimeGenerated >= ago(30m) - and TimeGenerated <= now() | summarize count() QUERY