- 0 minutes to read

Formula - base64encode

Easily encode text to base64 using the Nodinite base64encode Formula plugin. This page shows how to encode strings from message Content, Context, or the output of other formulas.

Key benefits:

  • ✅ Encode text from any Payload or Context in any Log Event
  • ✅ Support for character encodings like UTF-8, ISO-8859-1, and more
  • ✅ 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 base64encode Formula do?

The base64encode(Content) or base64encode(Content, 'Encoding') Formula function encodes a string to base64 format. Use it on message bodies, context values, or the results from other Formula functions to encode data in your views.


How it works: Input ➜ base64encode ➜ Result

graph LR A["Input: Plain text"] --> B["base64encode(Content, 'Encoding')"] B --> C["Result: Base64-encoded string"]

Diagram: Plain text content is encoded to base64 format, optionally using a specified character encoding.


Syntax

Encode from message body (default UTF-8): (See Example 1)

base64encode(body)

Encode with specific encoding (ISO-8859-1): (See Example 2)

base64encode(body, 'iso-8859-1')

Encode from message context: (See Example 3)

base64encode(context('MessageContextKey'))

Encode from nested formula: (See Example 4)

base64encode(jsonpath('$.path', body))

Supported encodings: UTF-8, ISO-8859-1, ASCII, UTF-16, and more.


Examples

Example 1: Encode text from message body

Input

Message body is Nodinite

Formula Expression

base64encode(body)

Result

Tm9kaW5pdGU=

Example 1
Example of encoding plain text 'Nodinite' to base64 using default UTF-8 encoding.


Example 2: Encode text with ISO-8859-1 encoding

Input

Message body is Skellefteå

Formula Expression

base64encode(body, 'iso-8859-1')

Result

U2tlbGxlZnRl5Q==

Example 2
Example of encoding text with special characters using ISO-8859-1 encoding, producing different output than default UTF-8.


Example 3: Encode text from context value

Input

Message context contains a property id with value Simple

Formula Expression

base64encode(context('id'))

Result

U2ltcGxl

Example 3
Example of encoding a context value extracted from message properties.


Example 4: Encode text from nested formula result

Input

Message body is:

[ { "name": "Hello" }, { "name": "World" } ]

Formula Expression

base64encode(jsonpath('$..name',body))

Result

SGVsbG8=, V29ybGQ=

Example 4
Example of encoding results from a nested jsonpath formula, showing multiple base64-encoded values.


Features

Important

The base64encode Formula converts text strings to base64-encoded format, making it easier to transmit or store data in Nodinite. You can optionally specify a character encoding (e.g., UTF-8, ISO-8859-1) when encoding the string.

  • Flexible Inputs: Encode from message body, Context, or the result of another Formula
  • Encoding Support: Optionally specify encoding (e.g., UTF-8, ISO-8859-1) to handle different character sets (see List of encodings)
  • Composable: Combine with other Formula functions like jsonPath or xPath for advanced transformations
  • Self-Service: Let business users encode and analyze text content without developer intervention
  • Performance Note: This function loads the entire message into RAM—use on small messages only

How to use

To use the base64encode Formula in a Search Field Expression:

  1. Open your Nodinite Web Client
  2. Navigate to AdministrationSearch Fields
  3. Create or edit a Search Field
  4. Choose Formula as the expression type
  5. See Syntax section above for common patterns and usage examples

Next step

Learn how to create a Search Field with an Expression

Formula Functions:

Search Fields: