Forum Discussion
Sean Tompkins
Oct 06, 2017Copper Contributor
Computer Groups with new query language?
I'm trying to set up computer groups in my OMS environment, but running into some issues. Has anyone used computer groups successfully with the new query language?
I see the created computer groups in settings, and can view members of the group from there. I created the group with a query that looks like this: Heartbeat | where Computer has "dev" | distinct Computer
The only blog I can find on using computer groups in queries is here, and it uses the older query language: https://blogs.technet.microsoft.com/msoms/2016/04/04/computer-groups-in-oms/
like this: Type:Perf ObjectName=Processor Computer IN $ComputerGroups[My Crepe Computers] | measure avg(CounterValue) by Computer interval 1HOUR
When I try to use this format in the Legacy language converter, I get an error saying "no viable alternative at input 'Heartbeat(Computerin'" (note that in my query there ARE spaces between Computer, in, and heartbeat). If I try the regular search window with 'Heartbeat | where (Computer in $ComputerGroups[mygroupname]' I get the error 'A recognition error occurred. Token: "in".' Finally, if I add ComputerGroups to the filter window, every query I try leaves the computergroup fields with no entries, so the filter is greyed out.
Has anyone worked with computer groups in the new OMS? Are they broken, or am I missing something? I've scoured the language documentation and can't find anything there...
Example:
Heartbeat | where Computer contains "SRV" | distinct Computer
You will create function out of this query and save with it with alias MyComputers for example. Than in a new query you can refer to it in this way for example:
Perf | where Computer in (MyComputers)
If it does not work right away in the Analytics Portal try refreshing it.
- Ketan Ghelani
Microsoft
Please refer to the documentation. Please refer to the "Notes" section that refers to the new query language.
- Richard_Pesenko
Microsoft
I was able to get this to work in my subscription:
Heartbeat | where Computer contains "<name>" | distinct ComputerI then saved the query, made a function of it, and used it to create a computer group.
- Sean TompkinsCopper Contributor
Can you use that computer group in a query? That's the part that is failing for me.
Example:
Heartbeat | where Computer contains "SRV" | distinct Computer
You will create function out of this query and save with it with alias MyComputers for example. Than in a new query you can refer to it in this way for example:
Perf | where Computer in (MyComputers)
If it does not work right away in the Analytics Portal try refreshing it.