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 simple demonstration example valid for this Formula plugin. 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 given text.
  • Return unique single true value only from Content if the matches occurred.
  • Can be applied on any valid Content that return text; Like jsonpath, xpath functions, review Formula user guide for complete list of functions.

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

How to use

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

  • Select Formula as expression type plugin.
  • Write down the expression to use in the 'Expression' text area.
  • Input a proper Content as 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 for how to use the endswith function.

Body as Content

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

e.g. endsWith('T',body)
endswithMessageBody

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 will be true.

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

endswithMessageContext

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 will be true.

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

endswithFormulaFuntion

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?