1. Docs
  2. Formulas
  3. Functions

IN_CIDR

Checks if an IP address or a list of IP addresses are in a given CIDR block. For a list, it returns true only if every address is in the block.

Categories: IP Addresses

Syntax

IN_CIDR(ip_address, cidr_range)

Examples

Example 1

Input

1
{
2
"my_action": {
3
"message": "127.0.0.1"
4
}
5
}

Formula

IN_CIDR(my_action.message, "10.0.0.0/8")

Output

false

Example 2

Input

1
{
2
"my_action": {
3
"message": "10.162.39.1"
4
}
5
}

Formula

IN_CIDR(my_action.message, "10.0.0.0/8")

Output

true

Example 3: Returns true when every address in the list is in the block

Input

1
{
2
"my_action": {
3
"message": [
4
"10.162.39.1",
5
"10.162.39.2"
6
]
7
}
8
}

Formula

IN_CIDR(my_action.message, "10.0.0.0/8")

Output

true

Example 4: Returns false if any address in the list is outside the block

Input

1
{
2
"my_action": {
3
"message": [
4
"10.162.39.1",
5
"192.168.1.1"
6
]
7
}
8
}

Formula

IN_CIDR(my_action.message, "10.0.0.0/8")

Output

false

Sample actions

Event Transform
My Action
Event Transform
IN_CIDR
Event Transform
My Action

Select an action to inspect

You can also click "Copy actions" and paste them in your Tines story to see how they work.

Was this helpful?