Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping of topic to specific index in elastic-sink connector #680

Open
rishabhk09 opened this issue Mar 29, 2023 · 6 comments
Open

Mapping of topic to specific index in elastic-sink connector #680

rishabhk09 opened this issue Mar 29, 2023 · 6 comments

Comments

@rishabhk09
Copy link

Hello

I am trying to map topic: mytopic to elasticsearch index: myindex in distributed mode configuration using this property- "topic.index.map": "mytopic:myindex".

But this functionality seems to be deprecated. Everywhere I see that it has been removed but I couldn't find an alternative or a straight work around.
#595
#385
#341

Hence, opening this for a verified solution.
Requesting folks to kindly help here.

Enviornment:
elasticsearch version: 7.17.9
kafka-connect-elasticsearch version: 14.0.3

@rishabhk09
Copy link
Author

@rmoff Requesting your assistance here!!

@rmoff
Copy link

rmoff commented Mar 29, 2023

Hi,

I don't work with Kafka directly anymore. A good place to go for help is https://www.confluent.io/en-gb/community/ask-the-community/.

thanks.

@rishabhk09
Copy link
Author

Thanks for the suggestion @rmoff

@Protoss78
Copy link

Not sure if it still helps - you can use the RegexRouter to change the topic name before it is written to Elastic: https://docs.confluent.io/platform/current/connect/transforms/regexrouter.html

We use this a couple of times. Works quite well. Although there are some restrictions when you work with Elastic 8. Then you have to set the flush.synchronously connector property to true.

@jliunyu
Copy link

jliunyu commented Dec 7, 2023

Not sure if it still helps - you can use the RegexRouter to change the topic name before it is written to Elastic: https://docs.confluent.io/platform/current/connect/transforms/regexrouter.html

We use this a couple of times. Works quite well. Although there are some restrictions when you work with Elastic 8. Then you have to set the flush.synchronously connector property to true.

@Protoss78 do you have any example for it?

@Protoss78
Copy link

@jliunyu
Sorry for the late reply.
Here is a short example I reduced from one of our running connectors:

  "name": "my-elastic-connector",
  "config": {
    "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
    "transforms": "changeIndexName",
    "topics": "original.topic.name",
    "transforms.changeIndexName.type": "org.apache.kafka.connect.transforms.RegexRouter",
    "transforms.changeIndexName.regex": ".*",
    "transforms.changeIndexName.replacement": "changed-topic-to-index-name"
    ...
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants