Forum Discussion
caitlin2250
Jun 26, 2021Copper Contributor
I am trying to create a watchlist that displays specific alerts from different business units
here is the query below. I would like to be able to determine which specific business unit server an alert was generated into Azure sentinel but I am unable to create a tag that includes a watchlist that provides the expected result. Please help
Heartbeat
| lookup kind=leftouter _GetWatchlist('MBSFQDN_01')
on $left.Computer == $right.SearchKey
| project UNIT, Computer
- LouisMastelinckBrass ContributorHi Caitlin
Just thinking out loud here:
Could it be possible that the computers in your watchlist are lowercase and in the logs are uppercase (or a mix). And there for now having a match and not showing the data.
Could a tolower() be a solution when setting up the join?- caitlin2250Copper ContributorHello Louis,
Thank you for the suggestion regarding case insensitive. I am afraid I am new to KQL so how do I incorporate that in this query below
Heartbeat
| lookup kind=leftouter _GetWatchlist('DEV1')
on $left.Computer == $right.SearchKey
| project UNIT, Computer
Will really appreciate you help with it. Look forward to hearing from you.
Thanks
Caitlin- caitlin2250Copper ContributorHello Luis. Your example works for me for my requirement due to simplicity but can you please explain what each line of code does so that I can have a clear understanding of it. Look forward to hearing from you. Thanks Caitlin
- caitlin2250Copper ContributorHi Luis thanks for the reply, maybe I wasn’t with my explanation
I need assistance in developing a KQL query that would add the extra property for Heartbeats.
The additional property would be the Team that manages the VM.
Let's say I have 100 VMs managed by five teams.
When I run the Heartbeat KQL query, I would like to see the team or business unit name that manages the VM.
My approach is to use a Watchlist with two columns. One column would be the Computer, and another column would be the name of the Team or business unit that owns the VM. So I would have five teams in the column Team or business unit and the list of computers assigned to each Team or business unit.
The Computer will be a search key.
The query I am planning to use is
Heartbeat
| lookup kind=leftouter _GetWatchlist('UNIT')
on $left.Computer == $right.SearchKey
After the query is complete, I would like to save it as a function.
Is it the right approach, or you could suggest something better?
Many Thanks
Caitlin- GaryBusheyBronze Contributor
caitlin2250 Your code looks correct. If you want to save it as a function, you can easily do that through the Logs UI. There is no parameter (aka filter) so you will get the full list each time if that is your intention. Otherwise it looks like it will work just fine.
I would think about LouisMastelinck comment about case sensitivity though. Granted using "=~" takes more processing so I would double check all the entries in the Heartbeat table to make sure they are in the case you are expecting.
- GaryBusheyBronze Contributor
caitlin2250 The code looks correct, what is the error you are getting or is it just missing data? You have all the fields you require in the watchlist, right?
- caitlin2250Copper ContributorHi Gary, Thanks for confirming that the code looks correct. I do not get any error. Yes it's just missing data that I am finding difficult to add on to the code. I would like for example for the Watchlist to include severs also not from the same business unit and be able to identify specific alerts from those servers also distinctively. At the moment I have only been able pull out information from servers within one business unit with this Watchlist and it does not meet the requirement, Hope I have explained it better. Thank you very much for taking the time to respond. Very much appreciated
- GaryBusheyBronze Contributor
caitlin2250 I don't see any reason why you would only get the one business unit returned. If you could paste some of the entries from your watchlist (changing the data to protect your machine names of course), it may help.
- EricStarkerFormer Employee
Hello! You've posted your question in the Tech Community Discussion space, which is intended for discussion around the Tech Community website itself, not product questions. I'm moving your question to the Azure Sentinel space- please post Azure Sentinel questions here in the future.
- caitlin2250Copper ContributorHi Eric. Thank you very much for the direction. Much appreciated