Forum Discussion
Dante Nahuel Ciai
Jan 15, 2018Brass Contributor
Search multiple perf counters
 Hi all, 
 I'm trying to learn the language and I want to search multiple perf counters on all connected computers, but I don't understand how. 
 for example: 
   
 Perf | where (CounterName == "% Com...
- Jan 15, 2018Hey Dante, Try this query, it shows a number of perf counters, and the average calculated per computer and counter name. The results show the counter name in a separate column. Is this what you were looking for? 
RagSaw
Jun 23, 2021Copper Contributor
I have diff types of server like APP, DB, Archival and DR, all are under the same log analytics workspace.
For which I want to set diff memory counters, like DB 80% APP 70% DR 30% so we get alerts.
Currently, we have set for all servers at 80 % as below how can we do the above?
Perf
| where CounterName == "% Committed Bytes In Use"
| where TimeGenerated > ago(30m) | summarize avg = avg(CounterValue) by Computer | where avg > 80
For which I want to set diff memory counters, like DB 80% APP 70% DR 30% so we get alerts.
Currently, we have set for all servers at 80 % as below how can we do the above?
Perf
| where CounterName == "% Committed Bytes In Use"
| where TimeGenerated > ago(30m) | summarize avg = avg(CounterValue) by Computer | where avg > 80
CliveWatson
Jun 24, 2021Former Employee
You need a way to identify the servers by their type, here I'm using the computer name in a few ways (just to show some of the options you can use), to find the computer type and then assign a value and a default value. You may have another identifier other than computer name, but you can use a "case" on that data, like this example:
Perf
| where TimeGenerated > ago(1h) 
| summarize by Computer, CounterName, CounterValue
| extend groupThreshold_ = case
                            (
                                Computer startswith "THAM", 10,
                                Computer endswith   "01",70,
                                Computer has        "aks",60,
                                Computer contains   "RDS",65,                       
                                //else use default value
                            50
                            )
| where CounterName == "% Committed Bytes In Use"
| summarize avg = avg(CounterValue) by Computer, groupThreshold_
| where avg > groupThreshold_     
- RagSawJun 24, 2021Copper ContributorHi Clive,
 I will try this, Thank you a lot for that :j