Functions for advanced enrichment and time-based enrichment

Functions are mathematical operations that can be be performed to manipulate slot values and to retrieve information related to slot values.

Void functions

These functions do not return a value. You can add void functions from the Actions toolbar. This action can be directly added on the policy workflow.

DropNewEvent

This is the only supported void function.

This function drops incoming events as they occur. After execution, the dropped events are not saved and are not available on the UI.



Non-void functions

These functions return a value. They can only be configured as the value for the Variable and Enrich actions. 

The following functions are supported:

StringLength

Returns the number of characters in a text string.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) whose length you want to find.

Maximum limit is 1024 characters. 

Expected output

Expected outputType
String length (in characters)Integer

Example

Input 1=HELLO WORLD

Output= 11



StringToInteger

Converts a text string that represents a number to an integer value. 

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a number value) that you want to convert.

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Conversion result, returned as an integerInteger

Example

Input 1=20

Output=20



StringToReal

Converts a text string that represents a real number to a real number. 

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a real number value) that you want to convert.

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Conversion result, returned as a real valueReal

Example

Input 1=10.2

Output=10.2



Substring

Returns part of a text string based on the given starting position and length.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) from which you want to extract the substring.

Maximum limit is 1024 characters. 

Start PositionInteger

Position of the character from where you want to begin extraction.

The first character in the text string starts at 1.

LengthIntegerNumber of characters that you want to extract. 

Expected output

Expected outputType
Retrieved stringString

Example

Input 1=HELLO WORLD

Input 2=1

Input 3=5

Output=HELLO



SubstringOnStartPosition

Returns part of a text string starting from the given start position to the end of the string.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) from which you want to extract the substring.

Maximum limit is 1024 characters. 

Start PositionInteger

Position of the character from where you want to begin extraction. The first character in the text string starts at 1.

Expected output

Expected outputType
Retrieved stringString

Example

Input 1= Hello World

Input 2=3

Output=llo World



SubstringOnPositions

Returns part of a text string between the start and end positions.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) from which you want to extract the substring.

Maximum limit is 1024 characters. 

Start PositionInteger

Position of the character from where you want to begin extraction.

The first character in the text string starts at 1.

End PositionInteger

Position of the character where you want to end extraction.

The first character in the text string starts at 1. 

Expected output

Expected outputType
Retrieved stringString

Example

Input 1= Hello World

Input 2=3

Input 3=6

Output=llo (includes the space character at the end)



GetPosition

Returns position of the first character of the first occurred substring, reading left to right.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) in which you want to find the substring.

Maximum limit is 1024 characters. 

Find SubstringString

Substring that you want to find in the text string.

Returns 0 if the substring is not found.

Expected output

Expected outputType
Position of the specified substringInteger

Example

Input 1=GetPosition v3 cool

Input 2=cool

Output=16



GetPositionOnOccurrences

Returns position of the first character of the final substring based on the number of occurrences specified, reading left to right, if the substring occurred for the given number of times. 

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) in which you want to find the substring.

Maximum limit is 1024 characters. 

Find SubstringString

Substring that you want to find in the text string.

Returns 0 if the substring is not found.

Number of OccurrencesInteger

Number of occurrences of the substring that you want to find.

Returns 0 if the specified number is not found.

Expected output

Expected outputType
Position of the specified substring based on occurrencesInteger

Example

Input 1=city reno is called reno

Input 2=reno

Input 3=2

Output=21



Split

Splits a text string into a list of substrings based on the separator occurring in the string.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) that you want to split.

Maximum limit is 1024 characters. 

SeparatorString

Character(s) in the text string at which you want to split the string.

The separator character(s) are not included in the resulting value.

Expected output

Expected outputType
List of substrings divided by the specified separatorString

Example

Input 1= Hello World

Input 2=" " 

Output=[Hello, World]



Concat

Concatenates two text strings to return a new string.

Input

InputTypeDescription
Text StringString

A single text string or reference to a slot or variable (with a string value) that you want to join.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Text StringString

A single text string or reference to a slot or variable (with a string value) that you want to join to the earlier string value.

Enclose values containing blank spaces or other special characters in double quotes

Maximum limit is 1024 characters. 


Expected output

Expected outputType
Result of concatenating the specified stringsString

Example

Input 1= Hello World

Input 2=[tagName1,tagName2,tagName3]

Output=Hello World[tagName1,tagName2,tagName3]



ConcatList

Concatenates a list of comma-separated strings using the given separator and returns a new string.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), that you want to join.

You cannot specify a combination of text strings, slots with string values, and variables with string values.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

SeparatorString

Alphanumeric or special character(s) by which you want to separate the new string.

Providing the separator is optional.

Expected output

Expected outputType
List of concatenating the specified string listList of string

Example

Input 1= tagName1,tagName2,tagName3

Output=tagName1 tagName2 tagName3



ConcatListToList

Concatenates two lists of comma-separated strings to return a new list.

Input

InputTYpeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), that you want to join.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), that you want to join to the earlier list.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Result of concatenating the specified listsList of string

Example

Input 1=abc,def,ghi

Input 2=123,456,789

Output=abc,def,ghi,123,456,789



ListUnion

Returns a union of all unique values between the two lists.

Duplicate values between the two lists are repeated only once. Duplicate values within a single list are retained.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), that you want to combine.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), that you want to combine with the earlier list.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Union of the specified listsList of string

Example

Input 1=[bmc,ade]

Input 2=[bmc,helix]

Output=[bmc,ade,helix]



Contains

Detects whether a text string contains a substring. 

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) in which you want to search.

Search is case insensitive.

Maximum limit is 1024 characters. 

Find SubstringString

Substring that you want to find in the text string.

Returns true if the substring is found, otherwise returns false.

Expected output

Expected outputType
Indicates whether the substring is present in the specified string.boolean

Example

Input 1=v1,v4,v5,v6

Input 2=v4

Output=true



Replace

Replaces part of a text string with another string.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) in which you want to replace a substring.


Maximum limit is 1024 characters. 

Old StringString

Existing substring that you want to replace in the text string.

New StringStringNew string with which you want to replace the old string.

Expected output

Expected outputType
New string created as a result of the replacementString

Example

Input 1= Hello World

Input 2=World

Input 3=User

Output=Hello User



ToLowerCase

Converts all letters in a text string to lower case.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) that you want to convert.

Characters that are not letters are not changed.

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Lower case version of the specified string.String

Example

Input 1= Hello User

Output=hello user



ToUpperCase

Converts all letters in a text string to upper case. 

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) that you want to convert.

Characters that are not letters are not changed.

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Upper case version of the specified stringString

Example

Input 1= Hello User

Output=HELLO USER



ListLength

Returns the number of elements in a list.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), whole length you want to find.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Expected output

Expected outputType
List length (in characters)Integer

Example

Input 1=html,css,javascript

Output=3



Strip

Removes leading and trailing blank spaces from a text string.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) from which you want spaces removed.

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Resulting string after the blank spaces are removedString

Example

Input 1=space " (provided without the double quotes)

Output=space



MatchRegex

Matches a text string with a simple regular expression.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) to use for matching.

Maximum limit is 1024 characters. 

Regex PatternStringRegular expression pattern to match with the text string.

Expected output

Expected outputType
Indicates whether the string matches the regular expressionBoolean

Example

Input 1=aaabbb

Input 2=a*b*

Output=true



RemoveElement

Removes all occurrences of an element from a list.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), from which you want to remove an element.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Remove ElementStringElement that you want to remove from the list. 

Expected output

Expected outputType
Resulting list after the specified element is removed.List of string

Example

Input 1=abc,def,ghi,jkl,mnp

Input 2=def

Output=abc,ghi,jkl,mnp



RemoveElementList

Removes a list of elements from a list.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values), from which you want to remove elements.

Enclose values containing blank spaces or other special characters in double quotes. 


Maximum limit is 1024 characters. 

Remove Element ListList of stringComma-separated list of elements occurring in the list that you want to remove. 

Expected output

Expected outputType
Resulting list after the specified list is removed.List of string

Example

Input 1=v1,v2,v3,v4,v5,v6

Input 2=v2,v3

Output=v1,v4,v5,v6



RemoveDuplicateElements

Removes duplicate elements from a list.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values) containing duplicate elements.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Resulting list after the duplicate elements are removed.List of string

Example

Input 1=v1,v2,v3,v4,v5,v6,v3,v2

Output=v1,v2,v3,v4,v5,v6



IsDisjoint

Compares elements of two lists to verify that no common elements exist between them.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values) that you want to compare.

Enclose values containing blank spaces or other special characters in double quotes. 


Maximum limit is 1024 characters. 

ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values) that you want to compare with the earlier list.

Enclose values containing blank spaces or other special characters in double quotes.

Maximum limit is 1024 characters. 

Returns true is no common elements exist, otherwise returns false.

Expected output

Expected outputType
Indicates that no common elements exist in the specified lists,Boolean

Example

Example 1:

  • Input 1=123,111Input1,def,ghi
  • Input 2=456,789,abc
  • Output=true (because no common elements are present in the two lists)


Example 2:

  • Input 1=123,111,456
  • Input 2=456,789
  • Output=true (because common elements are present in the two lists)


ListContains

Detects whether a list contains an element.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values) in which you want to search.

Search is case insensitive.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Find ElementString

Element that you want to find in the list.

Returns true if the element is found, otherwise returns false.

Expected output

Expected outputType
Indicates whether the element is present in the specified list.Boolean

Example

Input 1=v1,v2,v3,v4,v5,v6,v3,v2

Input 2=v1

Output=true



ListIntersect

Compares two lists to return the common elements between them.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values) that you want to compare.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 


Find ElementString

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values) that you want to compare with the earlier list.

Enclose values containing blank spaces or other special characters in double quotes. 

Maximum limit is 1024 characters. 

Expected output

Expected outputType
Common elements present in the two listsList of string

Example

Input 1=html,css,javascript

Input 2=css

Output=css



ListGetElement

Returns the element present in the given position in a list, reading left to right.

Input

InputTypeDescription
ListList of string

Comma-separated list of only text strings, only slots (with string values), or only variables (with string values) in which you want to find the element.

Enclose values containing blank spaces or other special characters in double quotes. 


Maximum limit is 1024 characters. 

PositionInteger

Position of the element, reading left to right. The first element in the list starts at 1.

Expected output

Expected outputType
Element present at the specified position in the list.String

Example

Input 1=oxford,cambridge,london

Input 2=2

Output=cambridge



Math

Performs basic mathematical operations on two numbers and returns the result. 

Input

InputTypeDescription
OperatorString

Arithmetic operator to use for the calculation.

Valid values are: +,-,*, /

First NumberInteger

First number to use for the calculation.

Second NumberIntegerSecond number to use for the calculation.

Expected output

Expected outputType
Resulting value of the mathematical operation performed.Integer

Example

Input 1=+

Input 2=5

Input 3=7

Output=12



StringMatch

Matches character patterns in a text string and extracts fields from it. The pattern can contain literal text and substitutes.

Input

InputTypeDescription
Text StringString

Text string or reference to a slot or variable (with a string value) to use for matching.

Maximum limit is 1024 characters. 

PatternString

Pattern to match the string.

The pattern can contain literal text and substitutes. Literal text is matched literally. A substitute is preceded by a % sign, followed by a type indicator.

The values corresponding to the substitutes are extracted as fields.

Valid values for substitutes:

  • %%: literal match of %
  • %d: decimal integer number
  • %f: floating point real number
  • %c: single character
  • %s: string value

Notes:

  • Two substitutes cannot occur without literal text in between them.

  • The portion of the input that matches the substitute of %s depends on the pattern following the substitute:
    • a literal: input up to the first literal.
    • a space and a literal: input up to the space followed by the literal.
    • a space and a substitute: input up to the first space.

Expected output

Expected outputType
Retrieved fieldsList of string

Example

Input 1=Hello World 2021

Input 2=Hello %s %d

Output=[World,2021]




Was this page helpful? Yes No Submitting... Thank you

Comments

  1. Tim Bocardo

    GetPositionOnOccurrences says it returns the position of the FIRST occurrence of the string, but it actually returns the position of the nth occurrence (where n is the number of occurrences passed in).

    Jan 19, 2021 02:10
    1. Priyanka Nanwani

      Redirecting this to R&D. Tim is added to the thread.

      Feb 26, 2021 05:55
      1. Priyanka Nanwani

        This is now corrected. 

        Mar 22, 2021 11:51