Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split out live and pre live query pack queries #1660

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
somesylvie marked this conversation as resolved.
Show resolved Hide resolved
}

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"]
somesylvie marked this conversation as resolved.
Show resolved Hide resolved

body = "AppServiceConsoleLogs | where _ResourceId contains 'pre-live' | project JsonResult = parse_json(ResultDescription) | evaluate bag_unpack(JsonResult) | project-reorder ['@timestamp'], level, message"
somesylvie marked this conversation as resolved.
Show resolved Hide resolved
}

resource "azurerm_log_analytics_query_pack_query" "application_error_logs" {
Expand Down
Loading