Skip to content

Create a Concatenation Transformer #20

@brbrown25

Description

@brbrown25

This was spurned based on conversations on this #19
@ivanyu I was thinking something like the following for this transformer. Let me know your thoughts and then I can take a crack at it!

field.names //fields to concat
field.name //field to place the concatenated string into
delimiter //the delimiter to be used
field.replace.missing //a value that should be used when no value is present for a given field

I'm not super sold on the name of those first two config keys though so would love your thoughts. Regardless, in practice you would get something like this.

"field.names" = "test,foo,bar"
"field.name" = "combined"
"delimiter" = "-"
"field.replace.missing" = "*"

for message

{
  "test": "something cool",
  "foo": true,
  "bar": 1,
  "timestamp": 1600864778131
}

it would transform to

{
  "test": "something cool",
  "foo": true,
  "bar": 1,
  "combined": "something cool-true-1",
  "timestamp": 1600864778131
}

and in the case where a field is missing

{
  "test": "something cool",
  "foo": true,
  "timestamp": 1600864778131
}

it would create

{
  "test": "something cool",
  "foo": true,
  "combined": "something cool-true-*",
  "timestamp": 1600864778131
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions