From a table with a column of IPs i would like to know which IPs are in a subnet from a table of which contains a column of subnets.
Attempt:
let IPs = SecurityAlert
| mv-expand parse_json(Entities)
| evaluate bag_unpack(Entities, columnsConflict='keep_source')
| distinct Address;
AzureIPTable
| extend ipv4_is_in_range(IPs, addressPrefixes)
Pretend addressPrefixes is a table of subnets in AzureIPTable and Address is a column of IPs in a table called SecurityAlert
I have reproduced in my environment and below are expected results:
Firstly IP's Table:Subnet Table:Now use below
KQL Query(to Check if IP is in Subnet IP's, which are in another table ) like below:Output:If present in range then gives true else gives false.
Fiddle.