-
AppExpert Applications and Templates
-
Configure application authentication, authorization, and auditing
-
-
Advanced Policy Expressions: Working with Dates, Times, and Numbers
-
Advanced Policy Expressions: Parsing HTTP, TCP, and UDP Data
-
Advanced Policy Expressions: IP and MAC Addresses, Throughput, VLAN IDs
-
-
This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
Basic operations on text
Basic operations on text include operations for string matching, calculating the length of a string, and controlling case sensitivity. You can include white space in a string that is passed as an argument to an expression, but the string cannot exceed 255 characters.
String comparison functions
The following table lists basic string matching operations in which the functions return a Boolean TRUE or FALSE.
Function | Description |
---|---|
<text>.CONTAINS(<string>) |
Returns a Boolean TRUE value if the target contains <string> . Example: http.req.url.contains(".jpeg")
|
<text>.EQ(<string>) |
Returns a Boolean TRUE value if the target is an exact match with <string> . For example, the following expression returns a Boolean TRUE for a URL with a host name of “myhostabc”: http.req.url.hostname.eq("myhostabc")
|
<text>.STARTSWITH(<string>) |
Returns a Boolean TRUE value if the target begins with <string> . For example, the following expression returns a Boolean TRUE for a URL with a host name of “myhostabc”: http.req.url.hostname.startswith("myhost")
|
<text>.ENDSWITH(<string>) |
Returns a Boolean TRUE value if the target ends with http.req.url.hostname.endswith("abc") |
<text>.NE(<string>) |
Returns a Boolean TRUE value if the prefix is not equal to the string argument. If the prefix returns a non-string value, the function argument is compared to the string representation of the value returned by the prefix. You can use the functions with SET_TEXT_MODE(IGNORECASE) or SET_TEXT_MODE(NOIGNORECASE) , and with both ASCII and UTF-8 character sets. |
<text>.GT(<string>) |
Returns a Boolean TRUE value if the prefix is alphabetically greater than the string argument. If the prefix returns a non-string value, the function argument is compared to the string representation of the value returned by the prefix. You can use the functions with SET_TEXT_MODE(IGNORECASE) or SET_TEXT_MODE(NOIGNORECASE) , and with both ASCII and UTF-8 character sets. |
<text>.GE(<string> ) |
Returns a Boolean TRUE value if the prefix is alphabetically greater than or equal to the string argument. If the prefix returns a non-string value, the function argument is compared to the string representation of the value returned by the prefix. You can use the functions with SET_TEXT_MODE(IGNORECASE) or SET_TEXT_MODE(NOIGNORECASE) , and with both ASCII and UTF-8 character sets. |
<text>.LT(<string> ) |
Returns a Boolean TRUE value if the prefix is alphabetically lesser than the string argument. If the prefix returns a non-string value, the function argument is compared to the string representation of the value returned by the prefix. You can use the functions with SET_TEXT_MODE(IGNORECASE) or SET_TEXT_MODE(NOIGNORECASE) , and with both ASCII and UTF-8 character sets. |
<text>.LE(<string>) |
Returns a Boolean TRUE value if the prefix is alphabetically lesser than or equal to the string argument. If the prefix returns a non-string value, the function argument is compared to the string representation of the value returned by the prefix. You can use the functions with SET_TEXT_MODE(IGNORECASE) or SET_TEXT_MODE(NOIGNORECASE) , and with both ASCII and UTF-8 character sets. |
Calculate the length of a string
The <text>.LENGTH
operation returns a numeric value that is equal to the number of characters (not bytes) in a string:
<text>.LENGTH
For example, you may want to identify request URLs that exceed a particular length. Following is an expression that implements this example:
HTTP.REQ.URL.LENGTH < 500
After taking a count of the characters or elements in a string, you can apply numeric operations to them. For more information, see Default Syntax Expressions: Working with Dates, Times, and Numbers.
Consider, ignore, and change text case
The following functions operate on the case (upper-case or lower-case) of the characters in the string.
Function | Description | |
---|---|---|
<text>.SET_TEXT_MODE (IGNORECASE |
NOIGNORECASE) | This function turns case sensitivity on or off for all text operations. |
<text>.TO_LOWER |
Converts the target to lowercase for a text block of up to 2 kilobyte (KB). Returns UNDEF if the target exceeds 2 KB. For example, the string “ABCd:” is converted to “abcd:”. | |
<text>.TO_UPPER |
Converts the target to uppercase. Returns UNDEF if the target exceeds 2 KB. For example, the string “abcD:” is converted to “ABCD:”. |
Strip specific characters from a string
You can use the STRIP_CHARS(<string>
) function to remove specific characters from the text that is returned by a default syntax expression prefix (the input string). All instances of the characters that you specify in the argument are stripped from the input string. You can use any text method on the resulting string, including the methods used for matching the string with a pattern set.
For example, in the expression CLIENT.UDP.DNS.DOMAIN.STRIP_CHARS(“.-_”), the STRIP_CHARS(<string>
) function strips all periods (.), hyphens (-), and underscores (_) from the domain name returned by the prefix CLIENT.UDP.DNS.DOMAIN. If the domain name that is returned is “a.dom_ai_n-name”, the function returns the string “adomainname”.
In the following example, the resulting string is compared with a pattern set called “listofdomains”:
CLIENT.UDP.DNS.DOMAIN.STRIP_CHARS(".-_").CONTAINS_ANY("listofdomains")
Note: You cannot perform a rewrite on the string that is returned by the STRIP_CHARS(<string>)
function.
The following functions strip matching characters from the beginning and end of a given string input.
Function | Description |
---|---|
<text>.STRIP_START_CHARS(s) |
Strips matching characters from the beginning of the input string until the first non-matching character is found and returns the remainder of the string. You must specify the characters that you want to strip as a single string within quotation marks. For example, if the name of a header is TestLang and :/en_us:is its value,HTTP.RES.HEADER(“TestLang”).STRIP_START_CHARS(“:“)strips the specified characters from the beginning of the value of the header until the first non-matching character e is found and returnsen_us: as a string. |
<text >.STRIP_END_CHARS(s) |
Strips matching characters from the end of the input string to the first non-matching character is found and returns the remainder of the string. You must specify the characters that you want to strip as a single string within quotation marks. For example, if the name of a header is TestLang and :/en_us:is its value,HTTP.RES.HEADER(“TestLang”).STRIP_START_CHARS(“:“)strips the specified characters from the end of the value of the header until the first non-matching character s is found and returns:/_en_us as a string. |
Append a string to another string
You can use the APPEND() function to append the string representation of the argument to the string representation of the value returned by the preceding function. The preceding function can be one that returns a number, unsigned long, double, time value, IPv4 address, or IPv6 address. The argument can be a text string, number, unsigned long, double, time value, IPv4 address, or IPv6 address. The resulting string value is the same string value that is obtained by using the + operator.
Share
Share
This Preview product documentation is Cloud Software Group Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Cloud Software Group Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Cloud Software Group product purchase decisions.
If you do not agree, select I DO NOT AGREE to exit.