-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-documentation-ingest-attachment-plugin
- Loading branch information
Showing
26 changed files
with
849 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
layout: default | ||
title: cidrContains() | ||
parent: Functions | ||
grand_parent: Pipelines | ||
nav_order: 5 | ||
--- | ||
|
||
# cidrContains() | ||
|
||
The `cidrContains()` function is used to check if an IP address is contained within a specified Classless Inter-Domain Routing (CIDR) block or range of CIDR blocks. It accepts two or more arguments: | ||
|
||
- The first argument is a JSON pointer, which represents the key or path to the field containing the IP address to be checked. It supports both IPv4 and IPv6 address formats. | ||
|
||
- The subsequent arguments are strings representing one or more CIDR blocks or IP address ranges. The function checks if the IP address specified in the first argument matches or is contained within any of these CIDR blocks. | ||
|
||
For example, if your data contains an IP address field named `client.ip` and you want to check if it belongs to the CIDR blocks `192.168.0.0/16` or `10.0.0.0/8`, you can use the `cidrContains()` function as follows: | ||
|
||
``` | ||
cidrContains('/client.ip', '192.168.0.0/16', '10.0.0.0/8') | ||
``` | ||
{% include copy-curl.html %} | ||
|
||
This function returns `true` if the IP address matches any of the specified CIDR blocks or `false` if it does not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
layout: default | ||
title: contains() | ||
parent: Functions | ||
grand_parent: Pipelines | ||
nav_order: 10 | ||
--- | ||
|
||
# contains() | ||
|
||
The `contains()` function is used to check if a substring exists within a given string or the value of a field in an event. It takes two arguments: | ||
|
||
- The first argument is either a literal string or a JSON pointer that represents the field or value to be searched. | ||
|
||
- The second argument is the substring to be searched for within the first argument. | ||
The function returns `true` if the substring specified in the second argument is found within the string or field value represented by the first argument. It returns `false` if it is not. | ||
|
||
For example, if you want to check if the string `"abcd"` is contained within the value of a field named `message`, you can use the `contains()` function as follows: | ||
|
||
``` | ||
contains('/message', 'abcd') | ||
``` | ||
{% include copy-curl.html %} | ||
|
||
This will return `true` if the field `message` contains the substring `abcd` or `false` if it does not. | ||
|
||
Alternatively, you can also use a literal string as the first argument: | ||
|
||
``` | ||
contains('This is a test message', 'test') | ||
``` | ||
{% include copy-curl.html %} | ||
|
||
In this case, the function will return `true` because the substring `test` is present within the string `This is a test message`. | ||
|
||
Note that the `contains()` function performs a case-sensitive search by default. If you need to perform a case-insensitive search, you can use the `containsIgnoreCase()` function instead. |
Oops, something went wrong.