- 2 minutes to read

Formula - endswith

endswith( ) Formula function is used to check if the end of text(string) is matches the provided expression.

Quick example

Let's get you started with the following example: For other, and more advanced examples please scroll down on this page to the Examples section.

Input Expression Result

  Nodinite 


endswith('inite',body)

true
Text Data endswith expression Unique values

Features

  • Check matching case at the end of a given text.
  • Return unique single true value only from Content if the matches occurred.
  • Can be applied to any valid Content that return text; Like jsonpath, xpath functions, review Formula user guide for the complete list of functions.

Important

This plugin loads the entire message into RAM, so make sure to apply this function only on small messages..

How to use

To use the endswith function, the Content parameter should contain a text/string (otherwise it will fail and you will end up with a garbage result). But first and foremost we have to configure the Formula plugin:

  • Select Formula as the expression type plugin.
  • Write down the expression to use in the 'Expression' text area.
  • Input proper Content as a parameter to the function.

Syntax

Use the endswith function with any of the following parameters:

  • From Message Body: endswith(body)

  • From Message Context: endswith(context('MessageContextKey'))

  • Result from previous Formula operation endswith(SomeOtherNestedFormulaFunction(Content))

Examples

Below you will find different common examples of how to use the endswith function.

Body as Content

The message body is normal text, by using the provided expression, the result is true.

e.g. endsWith('T',body)
Ends with Message Body

Message Body


  GMT

Expression


endsWith('T',body)


Context as Content

Example: The message context value for the corresponding key "id" is "GMT", by using the provided expression, the result is true.

e.g. endsWith('T',context('id'))

Ends with Message Context

Message Context Value


  GMT

Expression


endsWith('T',context('id'))


Formula Function as Content

The message body is regular text, by using the provided expression, the result is true.

e.g. endsWith('C',regex('GMT|UTC',body))

Ends with Formula Funtion

Message Body


  GMT UTC

Expression


endsWith('C',regex('GMT|UTC',body))


Next Step

How to Add or manage Search Fields
How to Add or manage Log Views

Expression Type Plugins are used in Search Fields
What are Search Fields?
What are Search Field Expressions?
What are Message Types?
What are Log Views?