This example sets the table's interactive retention to 30 days, and the total retention to two years, which means that the archive duration is 23 months: az monitor log-analytics workspace table update -subscription ContosoSID -resource-group ContosoRG -workspace-name ContosoWorkspace -name AzureMetrics -retention-time 30 -total-retention-time 730 To set the retention and archive duration for a table, run the az monitor log-analytics workspace table update command and pass the -retention-time and -total-retention-time parameters. This example sets the table's interactive retention to the workspace default of 30 days, and the total retention to two years, which means that the archive duration is 23 months. Set this property to null if you don't want to archive data. The table's total data retention including archive period. For a Basic Logs table, the value is always 8. Setting this property to null will default to the workspace retention. The request body includes the values in the following table. The PATCH API doesn't change the retentionInDays or totalRetentionInDays values if you don't specify values.The PUT API sets retentionInDays and totalRetentionInDays to the default value if you don't set non-null values.You can use either PUT or PATCH, with the following difference: Instead, you set the total retention, which is the sum of the interactive retention plus the archive duration. You don't explicitly specify the archive duration in the API call. You can set the archive period for a total retention time of up to 2,556 days (seven years). You can keep data in interactive retention between 4 and 730 days. You can modify the retention and archive policies of individual tables, except for workspaces in the legacy Free Trial pricing tier. Set retention and archive policy by tableīy default, all tables in your workspace inherit the workspace's interactive retention setting and have no archive policy. Move the slider to increase or decrease the number of days, and then select OK. Select Data Retention at the top of the page. Select Usage and estimated costs in the left pane. To set the default workspace retention policy:įrom the Log Analytics workspaces menu in the Azure portal, select your workspace. If you're on the free tier, you'll need to upgrade to the paid tier to change the data retention period. You can set a different policy for specific tables by configuring the retention and archive policy at the table level. You can set the workspace default retention policy in the Azure portal to 30, 31, 60, 90, 120, 180, 270, 365, 550, and 730 days. Configure the default workspace retention policy You can purge data immediately when required. When you shorten an existing retention policy, Azure Monitor waits 30 days before removing the data, so you can revert the change and prevent data loss in the event of an error in configuration. The archive period can only be set at the table level, not at the workspace level. You can access archived data by running a search job or restoring archived logs. Log Analytics immediately archives any data that's older than eight days. You decide to change the retention policy to eight days of interactive retention and one year total retention. For example, you might have an existing table with 30 days of interactive retention and no archive period. If you change the archive settings on a table with existing data, the relevant data in the table is also affected immediately. When you set a total retention period that's longer than the interactive retention period, Log Analytics automatically archives the relevant data immediately at the end of the retention period. When you no longer use the logs, but still need to keep the data for compliance or occasional investigation, archive the logs to save costs.Īrchived data stays in the same table, alongside the data that's available for interactive queries. You can set a different retention policy on individual tables.ĭuring the interactive retention period, data is available for monitoring, troubleshooting, and analytics. How retention and archiving workĮach workspace has a default retention policy that's applied to all tables. This article describes how to configure data retention and archiving. Archiving lets you keep older, less used data in your workspace at a reduced cost. Retention policies define when to remove or archive data in a Log Analytics workspace.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |