Formula - substring
Easily extract parts of strings using the Nodinite substring Formula plugin. This page shows how to slice strings from message Content, Context, or the output of other formulas.
π― Designed for business users and integrators β no developer required; you can even use AI to craft expressions.
- β Extract string parts from any Payload or Context in any Log Event
- β Specify start position and length to extract exactly what you need
- β 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 substring Formula do?
The substring(StartIndex, Length, Content) Formula function extracts a specific part of a string, starting at a given position and continuing for a specified length. Use it on message bodies, context values, or the results from other Formula functions to extract data in your views.
How it works: Input β substring β Result
Flow: The content is processed to extract a substring from the specified start position for the given length.
Example 1 β Extract from message body
Input from body
nodinite
Formula Expression
substring(0,4,body)
Result
nodi

Example: Extracting the first four characters from the message body.
Example 2 β Extract from context value
Suppose you have a message context value with the key id containing Amazing Function.
Input
Amazing Function
Formula Expression
substring(0,7,context('id'))
Result
Amazing

Example: Extracting the first seven characters from the context value.
Example 3 β Extract from nested formula result
Suppose you have a JSON array with names that you want to extract portions from.
Input
[ { "name": "column" }, { "name": "olive" } ]
Formula Expression
substring(0,2,jsonpath('$..name',body))
Result
Co, ol

Example: Extracting the first two characters from each name returned by the jsonpath function.
Features
- Extract substring from any Content by specifying start position and length
- Works with message body, context, or results from other Formula functions
- Combine with other Formula functions for powerful, layered expressions
- Use in Log Views for filtering, grouping, and self-service diagnostics
Important
The substring plugin loads the entire message into RAM. Only use this function on small messages to avoid performance issues.
How to use the substring Formula
- Select Formula as the expression type plugin.
- Enter your substring expression in the 'Expression' text area.
- Provide the start index, length, and Content parameter (for example, the message body, a context value, or another formula result).
Syntax
- Extract from message body:
substring(StartIndex, Length, body) - Extract from message context:
substring(StartIndex, Length, context('MessageContextKey')) - Extract from another formula:
substring(StartIndex, Length, SomeOtherNestedFormulaFunction(Content))
Next Step
How to Add or manage Search Fields
How to Add or manage Log Views
Related Topics
- 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?