From c9377e3f24c2014f200fbb99f470d2701cf4168b Mon Sep 17 00:00:00 2001 From: Sylvie Date: Tue, 17 Dec 2024 10:50:08 -0600 Subject: [PATCH] split out live and pre live query pack queries --- operations/template/logs.tf | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/operations/template/logs.tf b/operations/template/logs.tf index 90effe550..5ca51a8e4 100644 --- a/operations/template/logs.tf +++ b/operations/template/logs.tf @@ -47,14 +47,24 @@ resource "azurerm_log_analytics_query_pack" "application_logs_pack" { } } -resource "azurerm_log_analytics_query_pack_query" "application_logs" { - display_name = "TI's Raw Application Logs" - description = "View all TI's application logs in a structured format" +resource "azurerm_log_analytics_query_pack_query" "live_application_logs" { + display_name = "TI's Live Slot Raw Application Logs" + description = "View all TI's live slot application logs in a structured format" query_pack_id = azurerm_log_analytics_query_pack.application_logs_pack.id categories = ["applications"] - body = "AppServiceConsoleLogs | project JsonResult = parse_json(ResultDescription) | evaluate bag_unpack(JsonResult) | project-reorder ['@timestamp'], level, message" + body = "AppServiceConsoleLogs | where _ResourceId !contains 'pre-live' | project JsonResult = parse_json(ResultDescription) | evaluate bag_unpack(JsonResult) | project-reorder ['@timestamp'], level, message" +} + +resource "azurerm_log_analytics_query_pack_query" "prelive_application_logs" { + display_name = "TI's Pre-Live Slot Raw Application Logs" + description = "View all TI's pre-live slot application logs in a structured format" + + query_pack_id = azurerm_log_analytics_query_pack.application_logs_pack.id + categories = ["applications"] + + body = "AppServiceConsoleLogs | where _ResourceId contains 'pre-live' | project JsonResult = parse_json(ResultDescription) | evaluate bag_unpack(JsonResult) | project-reorder ['@timestamp'], level, message" } resource "azurerm_log_analytics_query_pack_query" "application_error_logs" {