实现logstash从rabbitmq取数据存elasticsearch
创始人
2024-03-20 11:46:07

input {
    rabbitmq {      
        host => "rabbitmq的ip:5672"
        vhost => "/"
        user => "rabbitmq用户名称"
        password => "rabbimq密码"
        durable => true
        exchange => "pro.community.exchange"    (配置指定rabbimq的交换器。)
        exchange_type => "direct"                        (交换器类型)
        key => "route.logstash.es.create"              (这个是routingkey)
        queue => "community_topic_create"          (rabbimq队列名称)
    }
}
filter {
         
}
output {
    elasticsearch {
        action => "create"          (对es的操作行为,具体可以看官网,这里是新增索引填create)
        hosts => ["elasticsearch的ip:9200"]
        user => "elastic"
        password => "密码"
        index => "索引名称"   
        document_id => "%{documentId}"   (指定es文档id,便于修改和删除)
        document_type => "%{documentType}"
    }
}

相关内容

热门资讯

井下有了“公交车” 兴隆职工实... (来源:兖矿能源)过去煤矿职工升井入井往往面临耗时长、体力消耗大等难题随着兖矿能源兴隆庄煤矿井下“公...
苹果官网刚刚更新:库克下场,特... 北京时间9月1日,苹果美国官网管理层介绍页面(Leadership)已完成更新,约翰・特努斯(Joh...
【每日函】2026年9月1日上... (来源:上交所债券)2/7债券名称无锡市惠山国有投资控股集团有限公司2026年面向专业投资者非公开发...
智通港股通活跃成交|9月1日 2026年9月1日当天,MINIMAX-W(00100)、智谱(02513)、阿里巴巴-W(0998...