Converts IPv6 or IPv4 string to a canonical IPv6 string representation.

parse_ipv6("") == '0000:0000:0000:0000:0000:ffff:7f00:0001'
parse_ipv6(":fe80::85d:e82c:9446:7994") == 'fe80:0000:0000:0000:085d:e82c:9446:7994'




  • Expr: String expression representing IPv6/IPv4 network address that will be converted to canonical IPv6 representation. String may include net-mask using IP-prefix notation.

IP-prefix notation

IP addresses can be defined with IP-prefix notation using a slash (/) character. The IP address to the LEFT of the slash (/) is the base IP address. The number (1 to 127) to the RIGHT of the slash (/) is the number of contiguous 1 bits in the netmask.


If conversion is successful, the result will be a string representing a canonical IPv6 network address. If conversion isn't successful, the result will be null.


datatable(ip_string:string, netmask:long)
 '',     32,  // 32-bit netmask is used
 '',  30,  // 24-bit netmask is used, as IPv4 address doesn't use upper 8 bits
 '',     24,  // 24-bit netmask is used
| extend ip_long = parse_ipv4_mask(ip_string, netmask)
ip_string netmask ip_long 32 3232301055 30 3232300800 24 4294967040