Formula - Equal

equal('Expression',Content) Formula function used to check whether two text(string) are equal or not, this function return true when both strings are matches.

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

  GMT


equal('GMT',body)

true
Text Data equal expression Unique values

Features

  • Check if two word/character are the same.
  • Return Unique true when matches regardless of the number of matches occurred per evaluation.
  • Can be applied on any valid Content that return text/string; 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 equal function the Content parameter should contain 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 equal function with any of the following parameters:

  • From Message Body: equal('Expression',body)

  • From Message Context: equal('Expression',context('MessageContextKey'))

  • Result from previous Formula operation equal('Expression',SomeOtherNestedFormulaFunction(Content))

Examples

Below you will find different common examples for how to use the equal function.

Body as Content

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

e.g. equal('GMT',body)
equal_simpleParameter

Message Body


 GMT

Expression


equal('GMT',body)


Context as Content

"GMT" is the Message context value and the key is "id", by using the provided expression the result will be true. e.g. equal('GMT', context('id'))

Simple equal_MessageContext

Message Context Value


GMT

Expression


equal('GMT', context('id'))


Formula Function as Content

Regex function has been used as a content parameter for equal function, by using the provided expression the result will be true.

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

equal_nested_body

Message Body


GMT UTC

Expression


equal('UTC',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?