ToCSV¶
ToCSV converts a set of metadata keys to CSV and applies it to Target.
Parameters¶
Keys
List of strings specifying the keys to write as CSV. Note that these keys can be paths. By default this parameter is set to an empty list.
Separator (default: ,)
The delimited string to insert between each value in the generated string. By default this parameter is set to “,”.
KeepLastSeparator
When set to true, the last separator will not be removed. By default this parameter is set to false.
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 get sthe foo and bar keys from the metdata of a message and set this as the new payload.
exampleProducer:
Type: producer.Console
Streams: "*"
Modulators:
- format.ToCSV:
Separator: ';'
Keys:
- 'foo'
- 'bar'