Deleting Custom Table from Azure Log Analytics


If you are familiar with Log Analytics you will know that you can delete custom field/column directly from the UI as you can see below:

Custom Field Delete

For example I can delete custom field _ResourceId_s for MyLog0001_CL table. That option has been there for quite some time. A couple of years ago an API was made available so you can delete specific data from a table. This was also know as the purge API. The purge API is basically deleting data based on KQL query. With these APIs you could delete specific fields and data but the table that was created by custom log will still be in the Log Analytics.

A few months ago a new API was released that allows you to delete a whole table. If you look at the picture above I have MyLog00001_CL table. When I search that table I do not have any recent data:

My Table

By using armclient tool I can easily execute that API to delete that specific table:

Delete Table

When executing the request there is no any output but if I check custom fields UI you can see that I no longer have _ResourceId field for MyLog0001_CL table:

Custom Field Delete table

If I try to search MyLog0001_CL table I will get an error:

Search failed

The above shows how you can delete a custom table from Log Analytics workspace. Keep in mind that any delete/purge operation on your Log Analytics workspace can have performance impact on it so execute such actions carefully, rarely and after significant consideration.

Any of these actions will also be logged in Azure Activity log in case someone has done this without authorization or by mistake:

Activity Log

I hope this was another useful blog post for you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.