Formula - base64encode

The base64encode( ) Formula function encodes any text/string Content to base64encoding format.

Quick example

Let's get you started with the following simple demonstration example valid for this Formula plugin. For other and more advanced examples please scroll down on this page to the Examples section.

Input Expression Result

Nodinite


base64encode(body)

Tm9kaW5pdGU=
Text Data from Body part of logged event base64encode expression Unique values

Features

  • Encodes text/string to base64encoding format.
  • Extracts single value only from Content.
  • Can be applied on any valid Content that return text/string data; Like jsonpath, xpath functions, review Formula user guide for complete list of functions.

This plugin loads the entire message into RAM, so make sure to apply this function on smaller messages only

How to use

In order to use the base64encode function the Content parameter should contain text/string data. But first and foremost we have to configure the Formula plugin:

  • Select Formula as expression type plugin.
  • Write down the expression to use in the 'Expression' text area.
  • Input a proper Content as parameter to the function.

Syntax

Use the base64encode function with any of the following parameters:

  • From Message Body: base64encode(body)

  • From Message Context: base64encode(context('MessageContextKey'))

  • Result from previous Formula operation base64encode(SomeOtherNestedFormulaFunction(Content))

Examples

Below you will find different common examples for how to use the base64encode function.

Body as Content

The message body is regular text "nodinite", by using the provided expression the result will be bm9kaW5pdGU=.

base64encode

Message Body


 nodinite

Expression


base64encode(body)


Context as Content

"Simple" is the value for the corresponding key "id", by using the provided expression the result will be U2ltcGxl.

base64encodeMessageContext

Message Context Value


 Simple

Expression


base64encode(context('id'))


Formula Function as Content

The message body is json structure, by using the provided expression the result will be SGVsbG8= , V29ybGQ= .

base64encodeFormulaFunctionAsContent

Message Body


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

Expression


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


Next Step

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

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?