简体   繁体   English

自动将在Kafka中创建的主题下沉到Elasticsearch

[英]Auto sinking of topics being created in kafka to elasticsearch

I have topics being created in kafka (test1, test2, test3) and I want to sink them to elastic at creation time. 我有在kafka中创建的主题(test1,test2,test3),我想在创建时使其变得弹性。 I tried topics.regex but it only creates indices for topics already existing. 我尝试了topic.regex,但它仅为已经存在的主题创建索引。 How can I sink a new topic into an index when it gets created dynamically? 动态创建新主题时,如何将其存储到索引中?

Here is the connector config that I am using for kafka-sink: 这是我用于kafka-sink的连接器配置:

{
    "name": "elastic-sink-test-regex",
    "config": {
        "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
        "tasks.max": "1",
        "topics.regex": "test[0-9]+",
        "type.name": "kafka-connect",
        "connection.url": "http://192.168.0.188:9200",
        "key.ignore": "true",
        "schema.ignore": "true",
        "schema.enable": "false",
        "batch.size": "100",
        "flush.timeout.ms": "100000",
        "max.buffered.records": "10000",
        "max.retries": "10",
        "retry.backoff.ms": "1000",
        "max.in.flight.requests": "3",
        "is.timebased.indexed": "False",
        "time.index": "at"
    }
}

A sink connector won't read new topics till this connector is restarted (or a scheduled rebalance occurred). 接收器连接器在重新启动此连接器(或发生计划的重新平衡)之前不会读取新主题。 You can run a Kafka Stream that reads messages from new topics and put them into a result-like topic. 您可以运行Kafka Stream来读取新主题中的消息,并将其放入类似结果的主题中。 A Sink Connector reads from the result-like topic. 接收器连接器读取类似结果的主题。

To save a "message - topic" matching you can use Kafka Record Headers. 要保存“邮件-主题”匹配项,可以使用Kafka记录标题。

Make sure it meets your requirements! 确保它满足您的要求!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 卡夫卡连接器 Elasticsearch topic.regex - Kafka connector Elasticsearch topics.regex 无法将主题映射到 kafka elasticsearch 连接器中的指定索引 - unable to map topics to specified index in kafka elasticsearch connector kafka-connect-elasticsearch 如何将多个主题路由到同一连接器中的同一 elasticsearch 索引? - kafka-connect-elasticsearch How to route multiple topics to same elasticsearch index in same connector? logstash 5.0.1:设置elasticsearch多个索引输出多个kafka输入主题 - logstash 5.0.1: setup elasticsearch multiple indexes ouput for multiple kafka input topics 使用 fast-data-dev 使用 docker 将 Kafka 主题连接到 elasticsearch - Connect Kafka topics to elasticsearch using fast-data-dev using docker Sematext Logagent Elasticsearch - 未创建索引? - Sematext Logagent Elasticsearch - Indexes not being created? Kafka连接ElasticSearch接收器-使用if-else块提取和转换不同主题的字段 - Kafka connect ElasticSearch sink - using if-else blocks to extract and transform fields for different topics Kafka-connect elasticsearch用于索引的自动小写主题名称 - Kafka-connect elasticsearch auto-lowercase topic name for for index 如何将索引策略自动应用于 AWS Elasticsearch 中新创建的索引 - How to auto apply index policy to newly created indexes in AWS Elasticsearch 您可以在 Elasticsearch 的自动创建索引中将字段设置为 not_analyzed 吗? - Can you set a field to not_analyzed in an auto created index in Elasticsearch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM