• Stars
    star
    148
  • Rank 248,711 (Top 5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Common Transforms for Kafka Connect.

Introduction

Documentation | Confluent Hub

This project contains common transformations for every day use cases with Kafka Connect.

Installation

Confluent Hub

The following command can be used to install the plugin directly from the Confluent Hub using the Confluent Hub Client.

confluent-hub install jcustenborder/kafka-connect-transform-common:latest

Manually

The zip file that is deployed to the Confluent Hub is available under target/components/packages/. You can manually extract this zip file which includes all dependencies. All the dependencies that are required to deploy the plugin are under target/kafka-connect-target as well. Make sure that you include all the dependencies that are required to run the plugin.

  1. Create a directory under the plugin.path on your Connect worker.
  2. Copy all of the dependencies under the newly created subdirectory.
  3. Restart the Connect worker.

Transformations

BytesToString

Key

com.github.jcustenborder.kafka.connect.transform.common.BytesToString$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.BytesToString$Value

Configuration

General

charset

The charset to use when creating the output string.

Importance: HIGH

Type: STRING

Default Value: UTF-8

fields

The fields to transform.

Importance: HIGH

Type: LIST

ChangeCase

Key

com.github.jcustenborder.kafka.connect.transform.common.ChangeCase$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.ChangeCase$Value

Configuration

General

from

The format to move from

Importance: HIGH

Type: STRING

Validator: Matches: LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE

to

Importance: HIGH

Type: STRING

Validator: Matches: LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE

ChangeTopicCase

com.github.jcustenborder.kafka.connect.transform.common.ChangeTopicCase

This transformation is used to change the case of a topic.

✍️ Example / πŸŽ₯ Video

Tip

This transformation will convert a topic name like 'TOPIC_NAME' to topicName, or topic_name.

Configuration

General

from

The format of the incoming topic name. LOWER_CAMEL = Java variable naming convention, e.g., "lowerCamel". LOWER_HYPHEN = Hyphenated variable naming convention, e.g., "lower-hyphen". LOWER_UNDERSCORE = C++ variable naming convention, e.g., "lower_underscore". UPPER_CAMEL = Java and C++ class naming convention, e.g., "UpperCamel". UPPER_UNDERSCORE = Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".

Importance: HIGH

Type: STRING

Validator: Matches: LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE

to

The format of the outgoing topic name. LOWER_CAMEL = Java variable naming convention, e.g., "lowerCamel". LOWER_HYPHEN = Hyphenated variable naming convention, e.g., "lower-hyphen". LOWER_UNDERSCORE = C++ variable naming convention, e.g., "lower_underscore". UPPER_CAMEL = Java and C++ class naming convention, e.g., "UpperCamel". UPPER_UNDERSCORE = Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".

Importance: HIGH

Type: STRING

Validator: Matches: LOWER_HYPHEN, LOWER_UNDERSCORE, LOWER_CAMEL, UPPER_CAMEL, UPPER_UNDERSCORE

ExtractNestedField

Key

com.github.jcustenborder.kafka.connect.transform.common.ExtractNestedField$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.ExtractNestedField$Value

Configuration

General

input.inner.field.name

The field on the child struct containing the field to be extracted. For example if you wanted the extract address.state you would use state.

Importance: HIGH

Type: STRING

input.outer.field.name

The field on the parent struct containing the child struct. For example if you wanted the extract address.state you would use address.

Importance: HIGH

Type: STRING

output.field.name

The field to place the extracted value into.

Importance: HIGH

Type: STRING

ExtractTimestamp

Key

com.github.jcustenborder.kafka.connect.transform.common.ExtractTimestamp$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.ExtractTimestamp$Value

This transformation is used to use a field from the input data to override the timestamp for the record.

✍️ Example / πŸŽ₯ Video

Configuration

General

field.name

The field to pull the timestamp from. This must be an int64 or a timestamp.

Importance: HIGH

Type: STRING

HeaderToField

Key

com.github.jcustenborder.kafka.connect.transform.common.HeaderToField$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.HeaderToField$Value

Configuration

General

header.mappings

The mapping of the header to the field in the message.

Importance: HIGH

Type: LIST

NormalizeSchema

Key

com.github.jcustenborder.kafka.connect.transform.common.NormalizeSchema$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.NormalizeSchema$Value

This transformation is used to convert older schema versions to the latest schema version. This works by keying all of the schemas that are coming into the transformation by their schema name and comparing the version() of the schema. The latest version of a schema will be used. Schemas are discovered as the flow through the transformation. The latest version of a schema is what is used.

Configuration

PatternFilter

Key

com.github.jcustenborder.kafka.connect.transform.common.PatternFilter$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.PatternFilter$Value

Configuration

General

pattern

The regex to test the message with.

Importance: HIGH

Type: STRING

Validator: com.github.jcustenborder.kafka.connect.utils.config.validators.PatternValidator@4170ee0f

fields

The fields to transform.

Importance: HIGH

Type: LIST

PatternRename

Key

com.github.jcustenborder.kafka.connect.transform.common.PatternRename$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.PatternRename$Value

Configuration

General

field.pattern

Importance: HIGH

Type: STRING

field.replacement

Importance: HIGH

Type: STRING

field.pattern.flags

Importance: LOW

Type: LIST

Default Value: [CASE_INSENSITIVE]

Validator: [UNICODE_CHARACTER_CLASS, CANON_EQ, UNICODE_CASE, DOTALL, LITERAL, MULTILINE, COMMENTS, CASE_INSENSITIVE, UNIX_LINES]

SchemaNameToTopic

Key

com.github.jcustenborder.kafka.connect.transform.common.SchemaNameToTopic$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.SchemaNameToTopic$Value

This transformation is used to take the name from the schema for the key or value and replace the topic with this value.

Configuration

SetMaximumPrecision

Key

com.github.jcustenborder.kafka.connect.transform.common.SetMaximumPrecision$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.SetMaximumPrecision$Value

This transformation is used to ensure that all decimal fields in a struct are below the maximum precision specified.

Note

The Confluent AvroConverter uses a default precision of 64 which can be too large for some database systems.

Configuration

General

precision.max

The maximum precision allowed.

Importance: HIGH

Type: INT

Validator: [1,...,64]

SetNull

Key

com.github.jcustenborder.kafka.connect.transform.common.SetNull$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.SetNull$Value

Configuration

TimestampNow

com.github.jcustenborder.kafka.connect.transform.common.TimestampNow

This transformation is used to override the timestamp of the incoming record to the time the record is being processed.

Configuration

TimestampNowField

Key

com.github.jcustenborder.kafka.connect.transform.common.TimestampNowField$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.TimestampNowField$Value

This transformation is used to set a field with the current timestamp of the system running the transformation.

✍️ Example / πŸŽ₯ Video

Configuration

General

fields

The field(s) that will be inserted with the timestamp of the system.

Importance: HIGH

Type: LIST

ToJSON

Key

com.github.jcustenborder.kafka.connect.transform.common.ToJSON$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.ToJSON$Value

Configuration

General

output.schema.type

The connect schema type to output the converted JSON as.

Importance: MEDIUM

Type: STRING

Default Value: STRING

Validator: [STRING, BYTES]

schemas.enable

Flag to determine if the JSON data should include the schema.

Importance: MEDIUM

Type: BOOLEAN

ToLong

Key

com.github.jcustenborder.kafka.connect.transform.common.ToLong$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.ToLong$Value

Configuration

General

fields

The fields to transform.

Importance: HIGH

Type: LIST

TopicNameToField

Key

com.github.jcustenborder.kafka.connect.transform.common.TopicNameToField$Key

Value

com.github.jcustenborder.kafka.connect.transform.common.TopicNameToField$Value

Configuration

General

field

The field to insert the topic name.

Importance: HIGH

Type: STRING

Development

Building the source

mvn clean package

Contributions

Contributions are always welcomed! Before you start any development please create an issue and start a discussion. Create a pull request against your newly created issue and we're happy to see if we can merge your pull request. First and foremost any time you're adding code to the code base you need to include test coverage. Make sure that you run mvn clean package before submitting your pull to ensure that all of the tests, checkstyle rules, and the package can be successfully built.

More Repositories

1

kafka-connect-spooldir

Kafka Connect connector for reading CSV files into Kafka.
Java
154
star
2

kafka-connect-archtype

Maven quick start for building Kafka Connect connectors.
Java
143
star
3

kafka-connect-twitter

Kafka Connect connector to stream data in real time from Twitter.
Java
126
star
4

kafka-connect-redis

Kafka Connect connector for Redis
Java
60
star
5

flume-ng-rabbitmq

Flume plugin for RabbitMQ
Java
59
star
6

kafka-connect-solr

Kafka Connect connector for writing to Solr.
Java
39
star
7

connect-utils

Utility project for working with Kafka Connect.
Java
32
star
8

kafka-connect-splunk

Kafka Connect connector for receiving data and writing data to Splunk.
Java
25
star
9

kafka-config-provider-aws

Kafka Configuration Provider for AWS Secrets Manager
Java
22
star
10

kafka-connect-transform-xml

Transformation for converting XML data to Structured data.
Java
22
star
11

kafka-connect-transform-archive

Kafka Connect transform to assist with archiving to S3.
Java
17
star
12

kafka-connect-json-schema

Java
14
star
13

puppet-confluent

Puppet Module for installing and configuring the Confluent Platform
Puppet
14
star
14

kafka-connect-cdc-postgres

Kafka Connect connector for CDC data from postgres
Java
12
star
15

kafka-connect-snmp

Kafka Connect connector for receiving SNMP data.
Java
11
star
16

kafka-config-provider-vault

Config provider for retrieving secrets from Hashicorp Vault.
Java
10
star
17

netty-codec-syslog

Netty codec for syslog
Java
10
star
18

cef-parser

Parser for Common Event Format messages
Java
8
star
19

kafka-connect-simulator

Kafka Connect connector for simulating a data flow.
Java
7
star
20

kafka-connect-docker

Docker container for all of the connectors and transforms maintained by me
7
star
21

kafka-connect-email

Kafka Connect Connector for email integrations.
Java
7
star
22

kafka-connect-examples

Example configurations for Kafka-Connect
7
star
23

confluent-ansible

Ansible playbook for installing the Confluent Platform
6
star
24

kafka-connect-memcached

Kafka Connect connector for Memcached
Java
6
star
25

connector-operator

Container to launch and manage connectors in a kubernetes environment
Java
6
star
26

kafka-jackson

Kafka Serializer, Deserializer, and Serde for Jackson JSON
Java
6
star
27

kafka-jaxb

Kafka Serializers / Deserializers for JAXB
Java
6
star
28

kafka-tools

Tools for managing Kafka and Kafka Connect.
Java
6
star
29

confluent-startup-scripts

Shell
6
star
30

kafka-connect-transform-maxmind

Kafka Connect transform to append MaxMind data.
Java
6
star
31

kafka-config-provider-azure

Java
5
star
32

kafka-vault

Java
5
star
33

jenkins-pipeline

Jenkins Pipeline for my public projects.
Groovy
5
star
34

kafka-connect-transform-fix

Kafka Connect Transformation for reading FIX messages.
Java
5
star
35

kafka-connect-transform-cef

Kafka Connect Single Message Transform for converting syslog messages to CEF format.
Java
5
star
36

kafka-connect-template

Github template repository for a Kafka Connect Plugin
Java
5
star
37

netty-codec-netflow

Netty decoder for Netflow V9
Java
4
star
38

vertica-stream-writer

Library is used to create streams in Vertica's Native Binary Format
Java
4
star
39

csid-connect-k8s

Java
3
star
40

kafka-config-provider-gcloud

Java
3
star
41

terraform-vmware-confluent

Terraform project to install the Confluent platform on a VMWare cluster.
HCL
3
star
42

cp-kafka-connect

3
star
43

kafka-connect-parent

Parent pom for Kafka Connect Connectors.
3
star
44

xjc-kafka-connect-plugin

Kafka Connect plugin to extend code generated by xjc to produce Kafka Connect Schemas and Structs.
Java
3
star
45

kafka-connect-transform-hl7

Kafka Connect Transform for reading HL7 structures.
2
star
46

kerberos-centos-6.6

Puppet
2
star
47

kafka-connect-aerospike

Kafka connect plugin for integrating with Aerospike
Java
2
star
48

kafka-connect-client

Client library for interacting with the Kafka Connect REST api.
Java
2
star
49

palo-alto-syslog-parser

Syslog parser for Palo Alto Network Devices
Java
2
star
50

kafka-connect-protobuf

2
star
51

kafka-load-testing

Kafka load testing with real world data.
Java
2
star
52

Amazon.Powershell

C#
2
star
53

kafka-connect-all

Docker container containing all of the connectors maintained by jcustenborder
Dockerfile
2
star
54

puppet-reposync

Puppet
1
star
55

kafka-connect-servlet

Framework for building webhook based kafka-connect connectors
Java
1
star
56

principal-generator

Python
1
star
57

kafka-connect-transform-cobol

Kafka Connect Transformations for converting data from Cobol.
Java
1
star
58

packagegenerator

Ruby
1
star
59

auditd-parser

Library to parse auditd log messages
1
star
60

kafka-connect-netflow

Kafka Connect connector for receiving NetFlow data from network devices.
1
star
61

kafka-connect-wits

Kafka Connect plugin for receiving data via the WITS protocol.
Java
1
star
62

kafka-streams-faa-swim

Java
1
star
63

kafka-connect-rethinkdb

Kafka Connect Plugin for RethinkDB
Java
1
star
64

kafka-connect-opentsdb

Java
1
star
65

mq-init-container

Python
1
star
66

chef-confluent

Chef cookbook for the Confluent Platform
Ruby
1
star
67

kafka-connect-google-apis

1
star
68

kafka-websocket-example

Java
1
star
69

extended-log-format-parser

Parser for Extended log format files.
Java
1
star
70

netty-codec-wits

Netty codec for implementing the WITS TCP protocol
Java
1
star