Need help filtering table when custom function returns true


Hey friends, I'm looking for some assistance on a Kusto query.

These are the datatables I am working with: 

let TableOfNetworks = datatable(cidr:string)[""];
let SigninTable = datatable(Username:string,IPAddress:string)
    "Zach", "",
    "Tom", "",
    "Jerry", ""

I have written a function that checks a single IPAddress against TableOfNetworks and returns the first match:

let ipMatchFunction = (ipCheck:string) {
    | where iff(ipCheck has ":",ipv6_is_match(ipCheck,cidr),ipv4_is_match(ipCheck,cidr))
    | take 1

Now my requirement is to filter SigninTable to only show entries where ipMatchFunction(IPAddress) successfully finds a match. I want to do something like this but cannot figure out the correct syntax:

| where toscalar(ipMatchFunction(IPAddress)) != "";
//should show "Zach", ""


Thanks for your help in advance! Hopefully I've made my problem clear. 

0 Replies