Using Azure Log Analytics Workspaces to collect Custom Logs from your VM

Using Azure Log Analytics Workspaces to collect Custom Logs from your VM

and no, we are not talking about the Azure Monitor with predefined metrics.

Motivation:

We all have seen the Monitoring Tab Key Metrics on the VM Page. Yes, it is useful to see whether the CPU has been running or not through the CPU *metrics, to check when the VM is getting the data from the outside world through *Network In metrics and if the VM is doing any kind of write operation using Disk Operations/Sec *metrics but it’s not effective for the custom services that we build on VM. So, in this blog, I will be giving you an example of how to create your own log based on customer service, bring it to *Azure Log Analytics Workspace using its default agent, and query it according to our needs, even better create an alert on it.

Prerequisites:

  1. An Azure Account
  2. Azure Virtual Machine Service
  3. Azure Log Analytics Workspace Service
  4. Azure Alert Service

Azure Virtual Machine:

Let’s start with the VM itself. You already have the service running on the VM but don't know how to get those logs into the portal or even create a log for your services. So, let’s assume that you have not created the logs for your services. So for this blog, I will be taking a simple flask app as my example for the service. To get it up and running we must download the flask library from pip and then create a flask app similar to this below:

logs log-analytics azure azure log analytics

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Azure Log Analytics Custom Logs Dashboard For Synapse Analytics

In this article, we will send data/metrics from Azure Synapse Analytics to Azure log analytics workspace and build an alert and dashboard on top of it.

Integrating Azure Purview with Azure Synapse Analytics

In this Tutorial, we will learn how to integrate Azure Purview and Azure Synapse Analytics capabilities to access data catalog assets hosted in Azure Purview from Azure Synapse.

Analyze Azure Cosmos DB data using Azure Synapse Analytics

This article will help you understand how to analyze Azure Cosmos DB data using Azure Synapse Analytics.

Creating An Azure API For Custom Logging In Azure Log Analytics

In this blog, we will create and set up an Azure API that will push custom logs to the Azure Log Analytics Workspace

How to access an Azure SQL database from Azure Data Lake Analytics

In this article, we will learn to access data in an Azure SQL database from Azure Data Lake Analytics.