首页 > 解决方案 > 融合弹性搜索接收器正则表达式分配给所有主题并发送到索引

问题描述

我有多个这样的主题

client1-table1
client1-table2
client1-table3
client1-table4

我希望我的弹性搜索接收器侦听任何传入消息并将它们相应地发送到索引。但是我当前的配置不起作用......我能做什么......下面是我的弹性搜索接收器

{
  "name": "es-data",
  "config": {
    "_comment": "-- standard converter stuff -- this can actually go in the worker config globally --",
    "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
    "value.converter": "io.confluent.connect.avro.AvroConverter",
    "key.converter": "io.confluent.connect.avro.AvroConverter",
    "key.converter.schema.registry.url": "http://localhost:8081",
    "value.converter.schema.registry.url": "http://localhost:8081",


    "_comment": "--- Elasticsearch-specific config ---",
    "_comment": "Elasticsearch server address",
    "connection.url": "http://127.0.0.1:9200",


    "_comment": "If the Kafka message doesn't have a key (as is the case with JDBC source)  you need to specify key.ignore=true. If you don't, you'll get an error from the Connect task: 'ConnectException: Key is used as document id and can not be null.",
    "key.ignore": "true"
  }
}

标签: elasticsearchapache-kafkaavroapache-kafka-connectconfluent-platform

解决方案


推荐阅读