ipv4_range_to_cidr_list()

Learn how to use the ipv4_range_to_cidr_list() function to convert IPv4 address range to a list of CIDR ranges.

Converts a IPv4 address range denoted by starting and ending IPv4 addresses to a list of IPv4 ranges in CIDR notation.

Syntax

ipv4_range_to_cidr_list(StartAddress , EndAddress )

Parameters

NameTypeRequiredDescription
StartAddressstring✔️An expression representing a starting IPv4 address of the range.
EndAddressstring✔️An expression representing an ending IPv4 address of the range.

Returns

A dynamic array object containing the list of ranges in CIDR notation.

Examples

print start_IP="1.1.128.0", end_IP="1.1.140.255"
 | project ipv4_range_list = ipv4_range_to_cidr_list(start_IP, end_IP)

Output

ipv4_range_list
["1.1.128.0/21", "1.1.136.0/22","1.1.140.0/24"]