EXPAND ALL
  • Home

cidrs_contain_ip

Determine whether the given IP is within anyone of the CIDR ranges provided. For example, 10.0.0.1 is contained in the CIDR range 10.0.0.0/24.

Returns: BOOLEAN

boolean representing whether the given IP is in any one of the given CIDR ranges.

Arguments

VariableTypeDescription
cidrsSTRINGJson array of CIDR ranges, where each CIDR range is a string of format '<IP>/<prefix_length>'
ip_addrSTRINGIP address to check for presence in range.

Examples:

df.cluster_cidrs = px.get_cidrs()| df.ip_is_in_cluster = px.cidrs_contain_ip(df.cluster_cidrs, df.remote_addr)
This site uses cookies to provide you with a better user experience. By using Pixie, you consent to our use of cookies.