Forum Discussion
Azure log analytics timechart with multiple dimensions
Following the https://docs.loganalytics.io/docs/Learn/Tutorials/Charts-and-diagrams#multiple-dimensions it says
Multiple expressions in the by clause creates multiple rows, one for each combination of values.
I want to query their sample database for networks bytes Send and Received per each computer. Starting with https://portal.loganalytics.io/demo?q=H4sIAAAAAAAAA1WOuwqDQBREe79iEAIKW2jAIoVpUqQLFpJ%2B1YkK7m64u%2BZFPj4PQsB6zjlMRTlFT1wHClGPhntaig7ssIXuXZJ3Kf7Azs02UA7aEGWJeIVKXEvvnXzl%2BIP62Rgt44PQlz75KUc9zUwVzpSWNowT%2FWJSKDKFTZECzR3NaJPFGYV8SN9t3gJth3oQ%2BsFNHUqss%2BgF6bL7icUAAAA%3D it should be something like
Perf | where TimeGenerated > ago(1d) | where (CounterName == "Bytes Received/sec" or CounterName == "Bytes Sent/sec") | summarize avg(CounterValue) by bin(TimeGenerated, 1h), Computer, CounterName | extend Threshold = 20 | render timechart
The problem is that Send and Received bytes gets grouped in the graph at computer level which doesn't make any sense.
How can multiple dimensions be represented as stated in the documentation so that I have Computer X Bytes Send and Computer X Bytes Received. As a note this was perfectly doable in the previous version.
2 Replies
- Ketan GhelaniFormer Employee
Can you please share how did you achieve this in the v1 version ?
- Guillem Sola ArandaCopper Contributor
Not as clean as I would like but I have figured out that a string concatenation would do the trick
Perf| where (CounterName == "Bytes Received/sec" or CounterName == "Bytes Sent/sec") and InstanceName matches regex "^Microsoft Hyper-V Network Adapter.*$"| summarize avg(CounterValue) by strcat(Computer, " ", CounterName), bin(TimeGenerated, 10s)| render timechart