How do I split field with comma separrated and I concatenate field1 field 2 [3 word first] in processor nifi?

Viewed 19

I split field with comma separrated field 1 field 2 and concatenate field1 field 2 [3 word first] example 2022-09-05T00:00:10,677 abc.1 , after split and concatenate 2022-09-05T00:00:10:677,abc.1,

1 Answers

You can use UpdateRecord and add a user-defined property something like /field3 set to concat( /field1, /field2 ). You can change /field3 to be whatever you want the output field name to be, and if you want to remove the other fields you can specify a schema in your Record Writer that only has the field(s) you want, such as:

{
    "type": "record",
    "name": "nifiRecord",
    "namespace": "org.apache.nifi",
    "fields": [{
        "name": "field3",
        "type": ["string", "null"]
    }]
}
Related