-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add error logs query in Azure #1192
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,24 @@ resource "azurerm_log_analytics_query_pack" "application_logs_pack" { | |
location = data.azurerm_resource_group.group.location | ||
} | ||
|
||
resource "azurerm_log_analytics_query_pack_query" "example" { | ||
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" | ||
|
||
query_pack_id = azurerm_log_analytics_query_pack.application_logs_pack.id | ||
categories = ["applications"] | ||
|
||
body = "AppServiceConsoleLogs | extend JsonResult = parse_json(ResultDescription) | project-away TimeGenerated, Level, ResultDescription, Host, Type, _ResourceId, OperationName, TenantId, SourceSystem | evaluate bag_unpack(JsonResult)" | ||
body = "AppServiceConsoleLogs | project JsonResult = parse_json(ResultDescription) | evaluate bag_unpack(JsonResult) | project-reorder ['@timestamp'], level, message" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we are no longer removing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because those columns are not included in the results anymore, so there is no need to remove them. I think the way the query was built before using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh! Hardcore! |
||
} | ||
|
||
resource "azurerm_log_analytics_query_pack_query" "application_error_logs" { | ||
display_name = "TI's Application Error Logs" | ||
description = "View all TI's application logs with error level 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) | where level == 'ERROR' | project-away level | project-reorder ['@timestamp'], message" | ||
} | ||
|
||
resource "azurerm_monitor_diagnostic_setting" "app_to_logs" { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent.