Forum Discussion
aprhn
Mar 11, 2020Copper Contributor
Query to use percentage of values
 Hello guys,    I'm beginner in Azure and I started a project in Azure Log Analytics.  I sent different values in a Custom Log from a Logic App (HTTP Request).             I have two values "cpu_used"...
- Mar 11, 2020You should be able to do the math with KQL. This is fake but should give you the idea Go to Log Analytics and run query // examplePerf| where ObjectName == "Processor" and InstanceName == "_Total"| project CounterName , CounterValue , Computer| summarize IdlePct = sumif(CounterValue, CounterName == "% Idle Time" ), UserTime = sumif(CounterValue, CounterName == "% User Time" ) by Computer| summarize percentage = (sum(UserTime) / sum(IdlePct)) * 100
CliveWatson
Mar 11, 2020Former Employee
You should be able to do the math with KQL. This is fake but should give you the idea
Go to Log Analytics and run query
// example 
Perf
| where ObjectName == "Processor" and InstanceName == "_Total"
| project CounterName , CounterValue , Computer 
| summarize IdlePct = sumif(CounterValue, CounterName == "% Idle Time" ), UserTime = sumif(CounterValue, CounterName == "% User Time" ) by Computer 
| summarize percentage = (sum(UserTime) / sum(IdlePct)) * 100
aprhn
Mar 19, 2020Copper Contributor
Hello Clive,
Thanks you ! I adapted your query and works fine :).
Regards,
Aurélien