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

Add error logs query in Azure #1192

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Conversation

basiliskus
Copy link
Contributor

@basiliskus basiliskus commented Jul 24, 2024

Add error logs query in Azure

  • Add error logs query in Azure
  • Updated TI's Raw Application Logs to simplify query and reorder columns
  • Removed test logging at startup to reduce noise in azure logs

Issue

#1143

@basiliskus basiliskus changed the title Added query for error logs and updated raw logs query Add query for error logs Jul 25, 2024
@basiliskus basiliskus changed the title Add query for error logs Add error logs query in Azure Jul 25, 2024
@basiliskus basiliskus marked this pull request as ready for review July 25, 2024 14:13
@basiliskus basiliskus requested a review from halprin July 25, 2024 14:14
Copy link

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we are no longer removing the TimeGenerated, Level, ResultDescription, Host, Type, _ResourceId, OperationName, TenantId, SourceSystem items from the logs? I'm under the impression that those are worthless columns that don't give us any benefit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 extend was including those columns, but I changed that to use project instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Hardcore!

Comment on lines -44 to -47
LOGGER.logInfo("Info");
LOGGER.logWarning("Warning");
LOGGER.logDebug("Debug");
LOGGER.logError("Error");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent.

@basiliskus basiliskus merged commit f782cca into main Jul 25, 2024
16 checks passed
@basiliskus basiliskus deleted the story/1143/add-terraform-log-query branch July 25, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants