- 0 minutes to read

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][body] 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

graph LR A["Input: String"] --> B["substring(StartIndex, Length, Content)"] B --> C["Result: Extracted portion"]

Flow: The content is processed to extract a substring from the specified start position for the given length.


Syntax

Extract from message body: (See Example 1)

substring(StartIndex, Length, body)

Extract from message context: (See Example 2)

substring(StartIndex, Length, context('MessageContextKey'))

Extract from nested formula: (See Example 3)

substring(StartIndex, Length, jsonpath('$.path', body))

Common patterns:

substring(0, 4, body)                # Extract first 4 characters
substring(0, 10, context('OrderId')) # Extract first 10 characters from context
substring(5, 3, body)                # Skip 5 characters, extract next 3

Note: Indexes are zero-based (first character is at position 0).


Examples

Example 1: Extract from message body

Input

Message body contains:

nodinite

Formula Expression

substring(0, 4, body)

Result

nodi

Simple Content parameter_substring


Example 2: Extract from context value

Suppose you have a message context value with the key id containing Amazing Function.

Input

Context value:

Amazing Function

Formula Expression

substring(0, 7, context('id'))

Result

Amazing

Simple Content parameter_substring


Example 3: Extract from nested formula result

Suppose you have a JSON array with names that you want to extract portions from.

Input

Message body contains:

[ { "name": "column" }, { "name": "olive" } ]

Formula Expression

substring(0, 2, jsonpath('$..name', body))

Result

Co, ol

nested Content parameter_substring


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

  1. Select Formula as the expression type plugin.
  2. Enter your substring expression in the 'Expression' text area.
  3. See Syntax section above for common patterns and usage examples.

Note: Indexes are zero-based (first character is at position 0).


Next Step

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