Transform

Transform stages let you take an incoming value, process or modify it in some way, and then pass the updated result to other stages in the pipeline.

Like a Custom Condition, transform stages manipulate data based on a provided expression. However, Transforms only operate on the event data. Use Transforms to shape or enrich events in a pipeline, whether the event contains raw input data or modeled data. Use Custom Conditions to clean up raw input before modeling or sending it to a pipeline.

Using Transform Expressions

Both the JavaScript and JSONata transform expressions have access to the following objects:

Event

The event variable contains read-only information about input event. Its type is described below.

class Event {
    /**
     * Unique ID of the parent event in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    **/
    parent: string;

    /**
     * Unique ID of the current event in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    **/
    id: string;

    /**
     * The event value. This is the value written to the pipeline for the first stage and value emitted by previous stages for all other stages.
    **/
    value: any;

    /**
     * Alias set by the Source when the value was input.
    **/
    alias: string;

    /**
     * Describes the quality of the value (typically Good or Bad)
    **/
    quality: string;

    /**
     * Date when the value was read.
    **/
    timestamp: Date;

    /**
     * Describes the value type. E.g Int8, Int32, ComplexData.
    **/
    type: string;

    /**
     * Describes the object name For ComplexData types.
    **/
    name: string;

    /**
     * Key:value object added to the event by previous stages in the pipeline.
    **/
    metadata: object;
}

System

The System variable contains read-only information about the hub. Its type is described below.

class System {
    /**
     * Read-only object containing all the System Variables defined for the hub instance.
     **/
    Variables: object;

    /**
     * Read-only object containing all the variable defined in the Environment (when enabled)
     **/
    Environment: object;

    /**
     * Read-only internal values
     **/
    Internal : {
        DateTime: Date
    }
}