Example

This example demonstrates how to use the Transformation to serialize multiple sensor attributes into one JSON attribute.

Refer to configuration to understand all configuration options of this Agent.

Step 1: Add the Agent

Drag the JSON Serializer Transformation Agent onto the canvas, link the input endpoint to the sensor readings and the output to the printer. Rename the Agent and save the Data Stream.

Step 2: Configure General

Select the Agent and click Configure. In this case, keep the default Collection.

Step 3: Configure Payload

Specify the input, date/time format and how the results are returned.

In this case, tick to select all the input colums, set the DateTime format to "MM/dd/yyyy".

Keep the default JArray output and results returned.

Step 4: Results

Apply the changes, save the Data Stream, and publish it.

Let's look at the Live Data View. Observe that a new property, JSON, was appended to the incoming events. It contains the serialized input properties.

Files

See the Import, Export, and Clone - XMPro article for steps to import a Data Stream.

Last updated