Forum Discussion
Custom OMS dashboard chart with 4 columns
Hi, cannot figure out how to create custom dashboard chart with 4 columns. i already have query for this dashboard. Just simple view, maybe with threshold colors. Thanks.
https://portal.loganalytics.io/Demo?q=H4sIAAAAAAAAA8WSQUvEMBCF7%2FkVQ0FoYC96VOphFUWwuqB4lWn6tmZtkpKk6Io%2F3mzVWlcWT2KObx7zXj6mRaRah8elBzp4BRsLWsAvxSs9PcCDbrXBOSw8R9R0TNy4fL%2BW4%2Fy6WkHFKzagoqDs0jVacXuadmbEtqYT19sIPxr26Cxl0U3HClnaEnpj2OsXUP4tajb4BtvivZgs2Df3hp%2B3jR8Rd9z2kFStk2C6PikzurAhslXYxI%2BVQ%2FQtbD6dydTtYOg7VUk5G1nbQNlhdiTaCaxy%2FsecBkolGq7WEeF3UuX83%2FlsHVLat3LailxQel%2FghBTO7u7QebchtcPw8yw%2Bvy%2FeAO%2BuQlfMAgAA
let diskfreepercent= Perf
| where TimeGenerated > ago(1d)
| where ObjectName == "LogicalDisk" and CounterName == "% Free Space"
| summarize (TimeGenerated, FreeSpacePercent)=arg_max(TimeGenerated, CounterValue) by Computer, InstanceName
| where strlen(InstanceName) ==2 and InstanceName contains ":";
let diskfreeMB= Perf
| where TimeGenerated > ago(1d)
| where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes"
| summarize (TimeGenerated, FreeMB)=arg_max(TimeGenerated, CounterValue) by Computer, InstanceName
| where strlen(InstanceName) ==2 and InstanceName contains ":";
diskfreepercent
| join
(
diskfreeMB
)
on Computer, InstanceName
| project Computer, InstanceName, FreeSpacePercent, FreeMB
To be precise the list view can show up 4 columns just not two columns where there are numbers. You can potentially do something like this:
let diskfreepercent= Perf | where TimeGenerated > ago(1d) | where ObjectName == "LogicalDisk" and CounterName == "% Free Space" | summarize (TimeGenerated, FreeSpacePercent)=arg_max(TimeGenerated, CounterValue) by Computer, InstanceName | where strlen(InstanceName) ==2 and InstanceName contains ":"; let diskfreeMB= Perf | where TimeGenerated > ago(1d) | where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes" | summarize (TimeGenerated, FreeMB)=arg_max(TimeGenerated, CounterValue) by Computer, InstanceName | where strlen(InstanceName) ==2 and InstanceName contains ":"; diskfreepercent | join ( diskfreeMB ) on Computer, InstanceName | project Computer, InstanceName, tostring(FreeSpacePercent), FreeMB
And it will show the 4 columns but as you see I am converting one of the numeric values to string. Also sorting can be done only on FreeMB column. My proposal is to create two lists views side by side.
8 Replies
Hi
I would guess you want to create a chart but it is not possible to create a chart on four columns. You can create a chart on two columns where one is one of them is for the x-Axes and the other for the y-Axes. Taking your example like this:
let diskfreepercent= Perf | where TimeGenerated > ago(1d) | where ObjectName == "LogicalDisk" and CounterName == "% Free Space" | summarize (TimeGenerated, FreeSpacePercent)=arg_max(TimeGenerated, CounterValue) by Computer, InstanceName | where strlen(InstanceName) ==2 and InstanceName contains ":"; let diskfreeMB= Perf | where TimeGenerated > ago(1d) | where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes" | summarize (TimeGenerated, FreeMB)=arg_max(TimeGenerated, CounterValue) by Computer, InstanceName | where strlen(InstanceName) ==2 and InstanceName contains ":"; diskfreepercent | join ( diskfreeMB ) on Computer, InstanceName | project Computer, FreeSpacePercent | render barchart
Of course this removes the InstanceName and the FreeMB columns. Only a table can list all 4 columns but that is not a chart.
- Anonymous
Ok. I though you've meant Azure Dashboard chart because you've pasted query that is executed in the Advanced portal. You cannot create List View in Log Analytics view that shows two numeric columns. You can either create List view with Free Space % or with FreeMB or two list views showing each one of them.