Create a Concatenation Transformer
Closed this issue · 1 comments
brbrown25 commented
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
}
brbrown25 commented
I should have a draft pr for this come Monday!