Double

Double is a formatter that duplicates a message and applies two different sets of formatters to both sides. After both messages have been processed, the value of the field defined as “source” by the double formatter will be copied from both copies and merged into the “target” field of the original message using a given separator.

Parameters

Separator (default: :)

This value sets the separator string placed between both parts. This parameter is set to “:” by default.

UseLeftStreamID (default: false)

When set to “true”, use the stream id of the left side (after formatting) as the streamID for the resulting message. This parameter is set to “false” by default.

Left

An optional list of formatters. The first copy of the message (left of the delimiter) is passed through these filters. This parameter is set to an empty list by default.

Right

An optional list of formatters. The second copy of the mssage (right of the delimiter) is passed through these filters. This parameter is set to an empty list by default.

Parameters (from core.SimpleFormatter)

Source

This value chooses the part of the message the data to be formatted should be read from. Use “” to target the message payload; other values specify the name of a metadata field to target. By default this parameter is set to “”.

Target

This value chooses the part of the message the formatted data should be stored to. Use “” to target the message payload; other values specify the name of a metadata field to target. By default this parameter is set to “”.

ApplyTo

Use this to set Source and Target to the same value. This setting will be ignored if either Source or Target is set to something else but “”. By default this parameter is set to “”.

SkipIfEmpty

When set to true, this formatter will not be applied to data that is empty or - in case of metadata - not existing. By default this parameter is set to false

Examples

This example creates a message of the form “<orig>|<hash>”, where <orig> is the original console input and <hash> its hash.

exampleConsumer:
  Type: consumer.Console
  Streams: "*"
  Modulators:
    - format.Double:
      Separator: "|"
      Right:
        - format.Identifier:
          Generator: hash