- 2 minutes to read

convert Formula function

The convert('source encoding', 'target encoding', Content) Formula function converts any string Content from the source encoding, to the target encoding.

New 5.4

Quick example

Let's get you started with the following example:

Input Expression Result

Skellefteå


convert('iso-8859-1', 'UTF-8', body)


Skellefteå

Text Data from Body part of logged event convert expression Converted string

Features

  • Convert the specified Content string from the source encoding, to the target encoding.
  • Can be applied to any valid Content that return a string;

Important

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

How to use

To use the convert function, the Content parameter should contain a string. But first and foremost we have to configure the Formula plugin:

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

Syntax

Use the convert function with any of the following parameters:

  • From Message Body: convert('source encoding', 'target encoding', body)

  • From Message Context: convert('source encoding', 'target encoding', context('MessageContextKey'))

  • Result from previous Formula operation convert('source encoding', 'target encoding', SomeOtherNestedFormulaFunction(Content))


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?