You hide it, we find it! Learn how to extract and modify returned values from just about any data structure
Formula plugin helps you to extract any value from any given message by applying solely one of the listed functions or by using a combination of them(Nested Functions) on your content. The formula plugin works like formulas for example in Excel (with functions as listed in reference table below)
Formula plugin supports powerful concept, (Multilevel Nested Functions) which is the key feature of this plugin.However,it is too early to consider it right away ,So we will demonstrate this as we move further with our examples (Test Expressions).
Expression Types are used in Search Fields.
How to Add or manage Search Field.
The documentation for the Formula plugin uses the notion of Content meaning either the actual payload (Body) or a named Context property.
The operations execute on data that comes any of the following
- Flatfile and CSV structures
Result from previous Formula operation
The Formula plugin have different types of functions for example math, string, logical, base64 and can all be nested like:
Function(1st Expression, 2nd Expression,Content)
Function(1st Expression,2nd Exp..,3rd...,Content)
|base64decode(Content)||Decode the provided data into a human readable format|
|base64encode(Content)||Encode text to base64|
|replace(1st Expression,2nd Expression,Content)||Used to replace old text/letter with a new text.|
|substring(1st Expression,2nd Expression,Content)||Extract specific text from any given statement/text|
|tolowercase(Content)||Convert any given text to LowerCase|
|touppercase(Content)||Convert any given text to UpperCase|
|csv(1st Expression,2nd Expression,...,Content)||Extract data from any valid CSV file|
|jsonpath(Expression,Content)||Used to extract value from JSON body structure|
|regex(Expression,Content)||Use Regular Expression as it is implemented everywhere to extract values|
|xpath(Expression,Content)||Retrieve values from XML body|
|equal(Expression,Content)||Check the equality of two given texts|
|endswith(Expression,Content)||Check if text ends with certain word/letter|
|notequal(Expression,Content)||Check the inequality of two given texts|
|startswith(Expression,Content)||Check if text starts with certain word/letter(s)|
|count(Content)||Return the count of the extracted values from the returned result of previous operation|