parse_ipv6()

Learn how to use the parse_ipv6() function to convert IPv6 or IPv4 strings to a canonical IPv6 string representation.

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

Syntax

parse_ipv6(ip)

Parameters

NameTypeRequiredDescription
ipstring✔️The IPv6/IPv4 network address that is converted to canonical IPv6 representation. The value may include net-mask using IP-prefix notation.

Returns

If conversion is successful, the result is a string representing a canonical IPv6 network address. If conversion isn’t successful, the result is an empty string.

Example

datatable(ipv4: string)
[
    '192.168.255.255', '192.168.255.255/24', '255.255.255.255'
]
| extend ipv6 = parse_ipv6(ipv4)

Output

ipv4ipv6
192.168.255.2550000:0000:0000:0000:0000:ffff:c0a8:ffff
192.168.255.255/240000:0000:0000:0000:0000:ffff:c0a8:ff00
255.255.255.2550000:0000:0000:0000:0000:ffff:ffff:ffff