简体   繁体   中英

How to get Custom Log tables from Azure Log Analytics Workspace through PowerShell script?

I am looking for a way to get all custom log tables from an Azure log analytics workspace through PowerShell code.

Below is an example of three custom log tables of which I would like to see the names in an object (array/list/...).

在此处输入图像描述

I am able to create a custom log table, insert and check data in it, but I am not able to upfront check if the table already exists, before I query on it.

I am using the Invoke-AzOperationalInsightsQuery PowerShell cmdlet to query on the custom log table, but this fails if the log does not exist yet. Hence the question.

Thanks for your input.

  • I have created sample custom log tables

在此处输入图像描述

and executed the below command

Get-AzOperationalInsightsDataSource -Kind CustomLog -ResourceGroupName RGName -WorkspaceName LogAnalyticsWorkSpaceName

在此处输入图像描述

Get-AzOperationalInsightsDataSource - Gets datasources under Azure Log Analytics workspace.

can you help me understand what is the purpose of this custom tables and custom fields? Also what action triggers the creation of these custom fields.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM