Is there a way to add performance counter in Azure Log Analytics from command line

徘徊边缘 提交于 2021-02-11 04:53:49

问题


Is there a way to added performance counter in Azure Log Analytics using Powershell or azure CLI. The only options I see are for querying.


回答1:


According to my research, we can use PowerShell command new-azoperationalinsightswindowsperformancecounterdatasource to add windows performance counter. For more details, please refer to the document. For example

Connect-AzAccount
$workspace=Get-AzOperationalInsightsWorkspace -ResourceGroupName jimtest -Name hybridWorkspace32979
New-AzOperationalInsightsWindowsPerformanceCounterDataSource -Workspace $workspace -Name "test" -ObjectName ".NET CLR Loading" -CounterName "Total Appdomains" -InstanceName "*" -IntervalSeconds 10
Get-AzOperationalInsightsDataSource -ResourceGroupName jimtest -WorkspaceName hybridWorkspace32979 -Kind WindowsPerformanceCounter

Besides, if you want to add Linux performance counter, you can use the command New-AzOperationalInsightsLinuxPerformanceObjectDataSource and Enable-AzOperationalInsightsLinuxPerformanceCollection. For more details, please refer to the article



来源:https://stackoverflow.com/questions/60302331/is-there-a-way-to-add-performance-counter-in-azure-log-analytics-from-command-li

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!