What Is Log Analytics? Azure Monitor Logs for Beginners
By Mirko Peters · · Updated
What is Log Analytics? A beginner's guide to the Azure Monitor workspace and query tool: how data gets in, your first KQL query, and how table plans and retention decide what you pay.
What is Log Analytics? In short, it is the place where Azure Monitor keeps and searches log data. Every sign-in, failed request and service restart becomes a record. Collected in one place and queried together, those records show patterns, such as a host that stops reporting every night or an account that fails sign-in hundreds of times in an hour.
Key points
- Log Analytics means two things: the workspace that stores log data in tables, and the query tool you open under Logs in the Azure portal.
- Azure Monitor Agent collects data from machines in Azure and, through Azure Arc, in other clouds and on-premises; data collection rules decide what is collected, how it is filtered and where it lands.
- Each table has a plan: Analytics for monitoring and alerts, Basic for troubleshooting, Auxiliary for high-volume data you mostly keep for audits.
- Analytics tables keep data for 30 days by default (90 days for some tables and in Sentinel workspaces), extendable to two years; total retention can reach 12 years.
- The workspace itself costs nothing. You pay for ingested data and retention, so filtering in the data collection rule and picking the right table plan are the main cost levers.
Below: how a workspace is organized, how data gets in, your first KQL query, and the two settings that decide your bill: table plan and retention.
What is Log Analytics: the workspace and the tool
The name covers two different things.
- The Log Analytics workspace is a data store. It can hold any type of log data from Azure and non-Azure resources and applications. Microsoft Sentinel, Defender for Cloud, workbooks and Power BI can all read from it.
- The Log Analytics tool is the query editor in the Azure portal. You open it by selecting Logs in Azure Monitor, in a workspace or on a single resource. From a workspace you see all its records; from a resource you only see that resource's data.
Both belong to Azure Monitor, as the logs half of its data platform next to Azure Monitor Metrics.
Tables: how a workspace is organized
A workspace contains many tables. Azure Monitor creates tables automatically for Azure monitoring data, such as Heartbeat, Perf or AzureActivity, which fill once data is sent to them. For data Microsoft has never seen, such as logs from your own application, you create custom tables and define their schema once.
Every record has a TimeGenerated timestamp, so every query can be narrowed to a time window such as "last night".
How data gets in
Nothing arrives on its own. For virtual machines, the collector is the Azure Monitor Agent. It runs on Windows and Linux machines in Azure, and through Azure Arc also on machines in other clouds and on-premises. The agent itself is free; you pay for the data it sends.
The agent doesn't decide what to collect. A data collection rule (DCR) does. A DCR defines the data sources, the schema, optional transformations that filter or reshape data, and the destination table. One DCR can be associated with many machines, so you write a baseline once and reuse it.
Two more paths:
- Azure resources such as Key Vault, App Service or Azure SQL send their resource logs through a diagnostic setting that you create on each resource and point at the workspace. Without one, those logs are not collected.
- Custom applications send data through the Logs Ingestion API, which replaces the legacy HTTP Data Collector API. Support for that API ended on September 14, 2026. Ingestion still works for now, but the API is unsupported, so migrate any remaining senders.
One warning: the old Log Analytics agent (MMA) was retired on August 31, 2024, and after March 2, 2026 its data upload can stop at any time. If anything still runs it, migrate now.
My rule of thumb: put the filtering into the DCR transformation, not into your queries. Data you drop before ingestion is data you never pay for.
Asking questions with KQL
Queries are written in Kusto Query Language (KQL). A query starts with a table name, and each pipe | passes the result to the next step:
Heartbeat
| where TimeGenerated > ago(1d)
| summarize LastSeen = max(TimeGenerated) by Computer
| where LastSeen < ago(15m)
| sort by LastSeen asc
This lists every machine that sent a heartbeat in the last day but has been silent for more than 15 minutes, longest-silent first: the host that stops reporting from the start of this article. The operators you'll use most are where (filter), project (choose columns), summarize (group and count), sort and top.
Three beginner gotchas:
- KQL is case sensitive. Table and column names must match the casing shown in the schema pane.
- Put the time filter right after the table name, and start from a table instead of a
searchacross everything, which is slower. - Not ready for KQL? Simple mode lets you filter, sort and aggregate by pointing and clicking.
Results can be exported to Excel, CSV or Power BI, and a query can become an alert rule or be pinned to a workbook or dashboard. The same language powers Advanced Hunting in Microsoft Defender. For hands-on examples, see our KQL queries for Azure Virtual Desktop diagnostics.
Table plans: Analytics, Basic and Auxiliary
Each table has a plan, which drives cost and capability.
| Plan | Best for | Ingestion cost | Querying | Alerts |
|---|---|---|---|---|
| Analytics | Continuous monitoring, real-time detection | Standard, queries included | Full KQL, optimized | Yes |
| Basic | Troubleshooting and incident response | Reduced, queries billed | Full KQL, fixed 30 days interactive | Simple log alerts only |
| Auxiliary | Verbose logs, audit and compliance data | Minimal, queries billed | KQL, slower, not for real-time analysis | No |
In the portal the Auxiliary plan appears as "Auxiliary / Lake". Azure tables default to Analytics. Basic and Auxiliary support varies by table, while custom DCR-based tables support all three plans. You can switch a table's plan only once per week, and moving a table from Analytics to Auxiliary stops alerts on it.
My recommendation: keep anything you alert on in Analytics. Move only high-volume data you rarely query, such as verbose debug or firewall logs, to the cheaper plans.
Retention and what you pay for
Creating a workspace costs nothing. You pay for the data you ingest and for how long you keep it. Prices are set per region, so check yours before a large rollout.
| Topic | What Microsoft Learn says |
|---|---|
| Default retention | 30 days for most tables (90 for Usage, AzureActivity, Application Insights tables and workspaces with Microsoft Sentinel enabled); 31 days are included in the ingestion price |
| Analytics retention | Extendable to two years at extra cost |
| Total retention | Up to 12 years, older data retrieved with search jobs |
| Free tables | No ingestion charge for AzureActivity, Heartbeat, Usage and Operation |
| Billed size | Analytics and Basic: on average about 25 percent less than the incoming JSON size; Auxiliary is measured differently |
| Commitment tiers | Analytics Logs only: from 100 GB per day, up to 30 percent cheaper than pay-as-you-go (31-day commitment) |
There is also a daily cap. When it is reached, collection into Analytics and Basic tables stops until the workspace's reset hour, and you lose monitoring for the rest of that period. Treat the cap as a safeguard against unexpected spikes, not as routine cost control. My rule of thumb: set it clearly above your normal daily volume and create an alert rule, so a spike notifies someone instead of silently stopping collection.
If Microsoft Sentinel is enabled on a workspace, all data in it is subject to Sentinel charges as well. That's why Microsoft suggests separating security and operational data, unless combining them reaches a commitment tier.
Where to start
Pick one system that matters, connect it, and watch what arrives for a week before you add more. For a worked example, see setting up AVD Insights with Azure Monitor and Log Analytics. Log Analytics only shows what you collected, so set the DCR, table plan and retention for that system on day one, not during the first incident.
Sources
- Azure Monitor Logs overview (Microsoft Learn)
- Log Analytics workspace overview (Microsoft Learn)
- Overview of Log Analytics in Azure Monitor (Microsoft Learn)
- Get started with log queries in Azure Monitor (Microsoft Learn)
- Select a table plan (Microsoft Learn)
- Manage data retention in a Log Analytics workspace (Microsoft Learn)
- Azure Monitor Logs cost calculations and options (Microsoft Learn)
- Set daily cap on Log Analytics workspace (Microsoft Learn)
- Azure Monitor Agent overview (Microsoft Learn)
- Migrate to Azure Monitor Agent from Log Analytics agent (Microsoft Learn)
- Data collection rules in Azure Monitor (Microsoft Learn)
- HTTP Data Collector API (Microsoft Learn)
FAQ
What is Log Analytics in simple terms?
Log Analytics is the log part of Azure Monitor. A Log Analytics workspace stores log records from Azure and non-Azure sources in tables, and the Log Analytics tool in the Azure portal lets you query that data with KQL or with a point-and-click simple mode.
What is the difference between Azure Monitor and Log Analytics?
Azure Monitor is the overall monitoring platform. Its data platform has two halves: Azure Monitor Metrics for numeric time-series data and Azure Monitor Logs for detailed records. Log Analytics workspaces store the logs, and the Log Analytics tool is where you query them.
Do I need to know KQL to use Log Analytics?
No. The Log Analytics tool has a simple mode with a spreadsheet-like experience where you filter, sort and aggregate by pointing and clicking. KQL mode gives you the full query language when you need it, and the same skills carry over to alert rules and workbooks.
How long does Log Analytics keep data?
Analytics tables keep data for 30 days by default for most tables, and 90 days for Usage, AzureActivity, Application Insights tables and workspaces with Microsoft Sentinel. 31 days of analytics retention are included in the ingestion price. You can extend analytics retention to two years and total retention to 12 years. Basic tables are queryable for a fixed 30 days.
Is a Microsoft Sentinel workspace different from a Log Analytics workspace?
No. Microsoft Learn describes a Sentinel workspace as a Log Analytics workspace with Sentinel enabled. All data in that workspace is then subject to Sentinel charges in addition to Log Analytics charges, which is why many teams separate security and operational data.