Skip to content

Commit

Permalink
split out live and pre live query pack queries (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
somesylvie authored Dec 18, 2024
1 parent 365044c commit 50ce96f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions operations/template/logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 50ce96f

Please sign in to comment.