Formula - endswith
Easily check if text ends with a specific value using the Nodinite endswith Formula plugin. This page shows how to validate message Content, Context, or the output of other formulas, ensuring your integrations are accurate and reliable.
π― Designed for business users and integrators β no developer required; you can even use AI to craft expressions.
- β Instantly validate if text ends with a given string from any Payload or Context in any Log Event
- β Boolean result (true/false) for conditional logic and filtering
- β Transform and surface meaningful data in Nodinite Log Views, search filters, and self-service diagnostics
- β Combine with other Formula functions for powerful, layered expressions
What does the endswith Formula do?
The endswith('value', Content) Formula function checks if the provided text ends with the specified value. Use this function to validate data, filter results, or trigger actions based on text endings.
How it works: Input β endswith β Result
Flow: The text is checked to see if it ends with the specified value, returning a boolean result.
Examples
Below are practical examples showing how to check if text ends with a specific value.
Example 1: Check if Message Body Ends With Value
Input
Nodinite
Formula Expression
endswith('inite', body())
Result
true
Example: Checking if message body ends with a value
Example 2: Check if Context Value Ends With Value
Suppose you have a message context value with the key id containing GMT.
Input
GMT
Formula Expression
endswith('T', context('id'))
Result
true
Example: Checking if context value ends with a value
Example 3: Check if Result from Another Formula Ends With Value
You can use the result of another formula function as input. For example, extracting values with regex and checking if they end with a specific character.
Input
GMT UTC
Formula Expression
endswith('C', regex('GMT|UTC', body()))
Result
true
Example: Using another formula as input for endswith
Features
The endswith Formula function is highly flexible and can be nested with other formula functions. For instance, combine it with regex, jsonPath, or substring to validate extracted or transformed data.
- Check if text ends with a specific value for data validation
- Returns boolean
trueorfalsefor conditional logic - Works with message body, Context, or results from other Formula functions
- Ensures data integrity across integrated systems
Important
The endswith plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.
How to use
The endswith formula validates if text ends with a specified string. It's ideal for suffix validation, file extension checks, or conditional filtering.
Syntax
endswith('value', Content)
Parameters:
- value (string): The suffix string to check for, e.g.,
'inite','.xml','@example.com' - Content (string): The text content to validate, typically from body() or context()
Common patterns:
endswith('inite', body())β Check if body ends with "inite"endswith('.xml', context('filename'))β Validate XML file extensionendswith('T', context('timezone'))β Check timezone suffix
Use with different sources:
- Check message body:
endswith('suffix', body()) - Check message context:
endswith('value', context('MessageContextKey')) - Check formula result:
endswith('C', regex('GMT|UTC', body()))
Next step
- How to Add or manage Search Fields
- How to Add or manage Log Views
Related Topics
- Body β Extract body from the Log Event
- Context β Extract context values from the Log Event
- startsWith β Check if text starts with a specific value
- equal β Check if values are equal
- regex β Extract data using regular expressions
- jsonPath β Extract values from JSON using JSONPath expressions
- 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?


