IP Address Functions
isSubnetOf
isSubnetOf(ipPrefix, ipAddress)SELECT isSubnetOf('192.168.1.0/24', clientIp) AS is_internal
FROM accessLog
WHERE isSubnetOf('10.0.0.0/8', clientIp)
-- Filters rows where clientIp is in the 10.0.0.0/8 private rangeipPrefix
ipPrefix(ipAddress, prefixBits)SELECT ipPrefix(clientIp, 24) AS subnet
FROM accessLog
LIMIT 5
-- For clientIp='192.168.1.100', returns '192.168.1.0/24'ipSubnetMin
ipSubnetMax
Last updated
Was this helpful?

