Manage data retention in a Log Analytics workspace - Azure Monitor (2024)

  • Article

A Log Analytics workspace retains data in two states:

  • Interactive retention: In this state, data is available for monitoring, troubleshooting, and near-real-time analytics.
  • Long-term retention: In this low-cost state, data isn't available for table plan features, but can be accessed through search jobs.

This article explains how Log Analytics workspaces retain data and how to manage the data retention of tables in your workspace.

Interactive, long-term, and total retention

By default, all tables in a Log Analytics workspace retain data for 30 days, except for log tables with 90-day default retention. During this period - the interactive retention period - you can retrieve the data from the table through queries, and the data is available for visualizations, alerts, and other features and services, based on the table plan.

You can extend the interactive retention period of tables with the Analytics plan to up to two years. The Basic and Auxiliary plans have a fixed interactive retention period of 30 days.

Note

You can reduce the interactive retention period of Analytics tables to as little as four days using the API or CLI. However, since 31 days of interactive retention are included in the ingestion price, lowering the retention period below 31 days doesn't reduce costs.

To retain data in the same table beyond the interactive retention period, extend the table's total retention to up to 12 years. At the end of the interactive retention period, the data stays in the table for the remainder of the total retention period you configure. During this period - the long-term retention period - run a search job to retrieve the specific data you need from the table and make it available for interactive queries in a search results table.

How retention modifications work

When you shorten a table's total retention, Azure Monitor Logs waits 30 days before removing the data, so you can revert the change and avoid data loss if you made an error in configuration.

When you increase total retention, the new retention period applies to all data that was already ingested into the table and wasn't yet removed.

When you change the long-term retention settings of a table with existing data, the change takes effect immediately.

Example:

  • You have an existing Analytics table with 180 days of interactive retention and no long-term retention.
  • You change the interactive retention to 90 days without changing the total retention period of 180 days.
  • Azure Monitor automatically treats the remaining 90 days of total retention as low-cost, long-term retention, so that data that's 90-180 days old isn't lost.

Permissions required

ActionPermissions required
Configure default interactive retention for Analytics tables in a Log Analytics workspaceMicrosoft.OperationalInsights/workspaces/write and microsoft.operationalinsights/workspaces/tables/write permissions to the Log Analytics workspace, as provided by the Log Analytics Contributor built-in role, for example
Get retention setting by table for a Log Analytics workspaceMicrosoft.OperationalInsights/workspaces/tables/read permissions to the Log Analytics workspace, as provided by the Log Analytics Reader built-in role, for example

Configure the default interactive retention period of Analytics tables

The default interactive retention period of all tables in a Log Analytics workspace is 30 days. You can change the default interactive period of Analytics tables to up to two years by modifying the workspace-level data retention setting. Basic and Auxiliary tables have a fixed interactive retention period of 30 days.

Changing the default workspace-level data retention setting automatically affects all Analytics tables to which the default setting still applies in your workspace. If you've already changed the interactive retention of a particular table, that table isn't affected when you change the workspace default data retention setting.

Important

Workspaces with 30-day retention might keep data for 31 days. If you need to retain data for 30 days only to comply with a privacy policy, configure the default workspace retention to 30 days using the API and update the immediatePurgeDataOn30Days workspace property to true. This operation is currently only supported using the Workspaces - Update API.

  • Portal
  • API
  • CLI
  • PowerShell

To set the default interactive retention period of Analytics tables within a Log Analytics workspace:

  1. From the Log Analytics workspaces menu in the Azure portal, select your workspace.

  2. Select Usage and estimated costs in the left pane.

  3. Select Data Retention at the top of the page.

  4. Move the slider to increase or decrease the number of days, and then select OK.

Configure table-level retention

By default, all tables with the Analytics data plan inherit the Log Analytics workspace's default interactive retention setting and have no long-term retention. You can increase the interactive retention period of Analytics tables to up to 730 days at an extra cost.

To add long-term retention to a table with any data plan, set total retention to up to 12 years (4,383 days). The Auxiliary table plan is currently in public preview, during which the plan's total retention is fixed at 365 days.

Note

Currently, you can set total retention to up to 12 years through the Azure portal and API. CLI and PowerShell are limited to seven years; support for 12 years will follow.

  • Portal
  • API
  • CLI
  • PowerShell

To modify the retention setting for a table in the Azure portal:

  1. From the Log Analytics workspaces menu, select Tables.

    The Tables screen lists all the tables in the workspace.

  2. Select the context menu for the table you want to configure and select Manage table.

  3. Configure the interactive retention and total retention settings in the Data retention settings section of the table configuration screen.

Get retention settings by table

  • Portal
  • API
  • CLI
  • PowerShell

To view a table's retention settings in the Azure portal, from the Log Analytics workspaces menu, select Tables.

The Tables screen shows the interactive retention and total retention periods for all the tables in the workspace.

What happens to data when you delete a table in a Log Analytics workspace?

A Log Analytics workspace can contain several types of tables. What happens when you delete the table is different for each:

Table typeData retentionRecommendations
Azure tableAn Azure table holds logs from an Azure resource or data required by an Azure service or solution and can't be deleted. When you stop streaming data from the resource, service, or solution, data remains in the workspace until the end of the retention period defined for the table.To minimize charges, set table-level retention to four days before you stop streaming logs to the table.
Custom log table (table_CL)Soft deletes the table until the end of the table-level retention or default workspace retention period. During the soft delete period, you continue to pay for data retention and can recreate the table and access the data by setting up a table with the same name and schema. Fourteen days after you delete a custom table, Azure Monitor removes the table-level retention configuration and applies the default workspace retention.To minimize charges, set table-level retention to four days before you delete the table.
Search results table (table_SRCH)Deletes the table and data immediately and permanently.
Restored table (table_RST)Deletes the hot cache provisioned for the restore, but source table data isn't deleted.

Log tables with 90-day default retention

By default, the Usage and AzureActivity tables keep data for at least 90 days at no charge. When you increase the workspace retention to more than 90 days, you also increase the retention of these tables. These tables are also free from data ingestion charges.

Tables related to Application Insights resources also keep data for 90 days at no charge. You can adjust the retention of each of these tables individually:

  • AppAvailabilityResults
  • AppBrowserTimings
  • AppDependencies
  • AppExceptions
  • AppEvents
  • AppMetrics
  • AppPageViews
  • AppPerformanceCounters
  • AppRequests
  • AppSystemEvents
  • AppTraces

Pricing model

The charge for adding interactive retention and long-term retention is calculated based on the volume of data you retain, in GB, and the number or days for which you retain the data. Log data that has _IsBillable == false isn't subject to ingestion or retention charges.

For more information, see Azure Monitor pricing.

Next steps

Learn more about:

  • Managing personal data in Azure Monitor Logs
  • Creating a search job to retrieve auxiliary data matching particular criteria
  • Restore data from the auxiliary tier for a specific time range
Manage data retention in a Log Analytics workspace - Azure Monitor (2024)

FAQs

Manage data retention in a Log Analytics workspace - Azure Monitor? ›

From the Log Analytics workspaces menu in the Azure portal, select your workspace. Select Usage and estimated costs in the left pane. Select Data Retention at the top of the page. Move the slider to increase or decrease the number of days, and then select OK.

How do I reduce retention in log analytics workspace? ›

In the Azure portal, find your Log Analytics workspace. Click on Usage and Estimate costs under the General section. Click on Daily Retention. Adjust the slider to the desired level of retention up to 730 days.

How do I monitor log analytics workspace? ›

To access Azure Log Analytics, you need to sign in to the Azure portal with your Azure account. Once you're signed in, you can access Log Analytics by selecting it from the list of services in the portal. To use Log Analytics, you need to create a Log Analytics workspace in your Azure subscription.

What is the retention period of activity log in Azure? ›

Activity log events are retained in the Azure platform for 90 days. Each PT1H. json blob contains a JSON object with events from log files that were received during the hour specified in the blob URL.

What is the difference between Azure Log Analytics workspace and Azure monitor workspace? ›

Log Analytics workspaces contain logs and metrics data from multiple Azure resources, whereas Azure Monitor workspaces currently contain only metrics related to Prometheus.

How do you manage data retention? ›

The following practices should be considered necessary when deciding on your data retention policy and its implementation.
  1. Categorize and periodically audit data. ...
  2. Identify legal requirements and schedule retention periods. ...
  3. Enact backups and backup testing. ...
  4. Ensure data purging and disposal measures are defined.

How do I clean up my log analytics workspace? ›

In the list of Log Analytics workspaces, select a workspace. Select Delete. A confirmation page appears that shows the data ingestion to the workspace over the past week. Enter the name of the workspace to confirm and then select Delete.

What is the Azure Log Analytics solution? ›

Log Analytics is a tool in the Azure portal that's used to edit and run log queries against data in the Azure Monitor Logs store. You might write a simple query that returns a set of records and then use features of Log Analytics to sort, filter, and analyze them.

How does Azure Monitor organize log data? ›

Azure Monitor organizes log data into tables. Azure Monitor organizes log data in tables, each composed of multiple columns. Every query contains data that's organized into a hierarchy similar to SQL (databases, tables, and columns).

Where is log analytics workspace data stored? ›

Each Log Analytics workspace contains multiple tables in which Azure Monitor Logs stores data you collect. Azure Monitor Logs automatically creates tables required to store monitoring data you collect from your Azure environment.

How do I increase Azure log retention? ›

From the Log Analytics workspaces menu in the Azure portal, select your workspace. Select Usage and estimated costs in the left pane. Select Data Retention at the top of the page. Move the slider to increase or decrease the number of days, and then select OK.

How long should log retention be? ›

What is a log retention period? A log retention period is the amount of time you keep logs. For example, you may keep audit logs and firewall logs for two months. However, if your organization must follow strict laws and regulations, you may keep the most critical logs anywhere between six months and seven years.

What is the retention range of Azure? ›

Azure Virtual Machine backup policy supports a minimum retention range from seven days up to 9999 days. By default, backup of VMs are kept for 7 days in snapshot and 180 days in vault.

What's the difference between Azure Monitor Log Analytics and Application insights? ›

If we think about the Azure Monitoring Platform/ecosystem, then Log Analytics and App Insights both play a role within that platform as shown below. Log Analytics plays a role in the storage of Log Data and analysis of Log Data. App Insights plays a role in the analysis and insights into log data.

What are the two main kinds of data Azure Monitor works with? ›

All data collected by Azure Monitor fits into one of two fundamental types: metrics and logs. Metrics are numerical values that describe some aspect of a system at a particular point in time. They are lightweight and capable of supporting near real-time scenarios.

What is the difference between log monitoring and log analytics? ›

Log monitoring and log analytics are related — but different — concepts that work in conjunction. Together, they ensure the health and optimal operation of applications and core services. Whereas log monitoring is the process of tracking logs, log analytics evaluates logs in context to understand their significance.

What is the maximum retention for log analytics workspaces? ›

By default, all tables with the Analytics data plan inherit the Log Analytics workspace's default interactive retention setting and have no long-term retention. You can increase the interactive retention period of Analytics tables to up to 730 days at an extra cost.

How do I change data retention in Google Analytics? ›

Make sure you are in the correct account and property.
  1. In the PROPERTY column, click Data Settings > Data Retention.
  2. Event data retention: select the retention period you want.
  3. Reset user data on new activity: turn the switch on or off.
  4. Click Save.

What is the data cap for log analytics workspace? ›

To set or change the daily cap for a Log Analytics workspace in the Azure portal: From the Log Analytics workspaces menu, select your workspace, and then Usage and estimated costs. Select Daily Cap at the top of the page.

How do I change the log retention period in CloudWatch? ›

Sign in to AWS Console and go to the CloudWatch console. Select Log Groups in the navigation pane. Select the log group to update. Select 'Edit retention' and change the log retention value to 90 days or more.

Top Articles
Go for GOOG: Why Alphabet Stock Is Still a Must-Buy in 2024
You have a Product Design interview coming up. What are some tips for presenting your portfolio?
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Rueben Jacobs

Last Updated:

Views: 5775

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Rueben Jacobs

Birthday: 1999-03-14

Address: 951 Caterina Walk, Schambergerside, CA 67667-0896

Phone: +6881806848632

Job: Internal Education Planner

Hobby: Candle making, Cabaret, Poi, Gambling, Rock climbing, Wood carving, Computer programming

Introduction: My name is Rueben Jacobs, I am a cooperative, beautiful, kind, comfortable, glamorous, open, magnificent person who loves writing and wants to share my knowledge and understanding with you.