Forum Discussion
I am trying to create a watchlist that displays specific alerts from different business units
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?
- caitlin2250Jun 30, 2021Copper 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- caitlin2250Jul 06, 2021Copper 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
- LouisMastelinckJul 06, 2021Brass Contributor
Hi caitlin2250
I don't have your dataset but I was thinking something like this:
Heartbeat
| extend ComputerUpper = toupper (Computer)
| lookup kind=leftouter _GetWatchlist('DEV1')
on tolower($left.ComputerUpper) == tolower($right.SearchKey)
| project UNIT, ComputerUpperGive it a try if it will accept this in your syntax.
- JBUB_AcceleryntJul 01, 2021Brass Contributor
Just as an example you could do something like below to change the Computer column to all upper case. (ComputerUpper just being what ever you want to name it.) You would need to to the same with your right column whatever that is if it also has lower case letters. You can use toupper or tolower, as long as both columns end up uniform.
Replacing the == with =~ wont work as the join only supports equalities.
Heartbeat
| extend ComputerUpper = toupper (Computer)
| lookup kind=leftouter _GetWatchlist('DEV1')
on $left.ComputerUpper == $right.SearchKey
| project UNIT, ComputerUpper- caitlin2250Jul 01, 2021Copper ContributorHello Jbub_Arbala, Thanks for the reply I have tried your query and the only problem I am seeing in the result is that it is only devices with uppercase naming in the result of the query. What I am looking for is to get both whether the name of the server is in uppercase or lowercase.
Thanks and look forward to hearing from you
Caitlin
- caitlin2250Jun 29, 2021Copper 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- GaryBusheyJun 29, 2021Bronze 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.