Skip to content

Commit

Permalink
Update ip.rst for consistency with Spark
Browse files Browse the repository at this point in the history
Signed-off-by: currantw <[email protected]>
  • Loading branch information
currantw committed Nov 28, 2024
1 parent 677bdc8 commit 43d05d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/user/ppl/functions/ip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@ CIDRMATCH
Description
>>>>>>>>>>>

Usage: cidrmatch(ip, cidr) returns whether the given IP address is within the specified CIDR IP address range. Supports both IPv4 and IPv6 addresses.
Usage: `cidrmatch(ip, cidr)` checks if `ip` is within the specified `cidr` range.

Argument type: STRING, STRING

Return type: BOOLEAN

Example::
Example:

os> source=weblogs | where cidrmatch(host, "199.120.110.0/24") | fields host ;
os> source=weblogs | where cidrmatch(host, '199.120.110.0/24') | fields host
fetched rows / total rows = 1/1
+----------------+
| host |
|----------------|
| 199.120.110.21 |
+----------------+

Note:
- `ip` can be an IPv4 or an IPv6 address
- `cidr` can be an IPv4 or an IPv6 block
- `ip` and `cidr` must be either both IPv4 or both IPv6
- `ip` and `cidr` must both be valid and non-empty/non-null

0 comments on commit 43d05d6

Please sign in to comment.