Forum Discussion
Samuel White
Dec 20, 2018Copper Contributor
Filtering based on groups
Hello all, I'm creating some dashboards for people who are responsible for tracking groups of computers. I'm trying to avoid having to make a series of identical queries that only have a "where" ...
- Dec 24, 2018Two ideas for you:
1. Workbooks have a more interactive experience. We are slowly rolling them out to all Azure Monitor but right now they are accessible only from Application Insights and VM Insights: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-usage-workbooks
2. Save the query as a function and use a variable for the group name. Set the variable before the call to the function (e.g. let groupname="mygroup";). Here is more on Log Analytics function: https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/functions
Samuel White
Dec 21, 2018Copper Contributor
I will attempt to answer my own question here. I was able to get this partially working the way I want with the View Designer Filters functionality detailed https://docs.microsoft.com/en-us/azure/azure-monitor/platform/view-designer-filters.
It seems to be what I'm looking for in this case, though the UI for users to specify filters is kind of clunky.
I created a filter named "Group" with the choices based on this https://docs.microsoft.com/en-us/azure/azure-monitor/platform/computer-groupsquery:
ComputerGroup | where GroupSource == "ActiveDirectory" | distinct Group
Then my query looks like this:
let FilterComputers = ComputerGroup
| where GroupSource == "ActiveDirectory" and Group == "${Group}"
| distinct Computer;
Perf
| where CounterName == "% Processor Time"
| summarize AggregatedValue = avg(CounterValue) by Computer, bin(TimeGenerated, 60m)
| where Computer in (FilterComputers) | sort by AggregatedValue desc