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
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 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 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 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 of encoding results from a nested jsonpath formula, showing multiple base64-encoded values.
Features
Important
The
base64encodeFormula 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:
- Open your Nodinite Web Client
- Navigate to Administration → Search Fields
- Create or edit a Search Field
- Choose Formula as the expression type
- See Syntax section above for common patterns and usage examples
Next step
Learn how to create a Search Field with an Expression
Related Topics
Formula Functions:
- Formula - Overview of Formula expression type
- base64decode - Decode base64-encoded data
- convert - Fix character encoding issues
- jsonpath - Extract data from JSON
- xpath - Extract data from XML
- toLowercase - Convert text to lowercase
- toUppercase - Convert text to uppercase
Search Fields:
- Search Field - Create and manage Search Fields
- Search Field Expressions - Expression types overview
- Log Views - Display encoded data in views
- Administration - Access Search Fields configuration