2016-08-02 59 views
1

我已經安裝了彈性搜索2.3.4在Ubuntu 14.04的RabbitMQ插件ElasticSearch 2.X

http://10.x.x.11:9200/

{ 
    "name" : "Everett Thomas", 
    "cluster_name" : "elasticsearch", 
    "version" : { 
    "number" : "2.3.4", 
    "build_hash" : "e455fd0c13dceca8dbbdbb1665d068ae55dabe3f", 
    "build_timestamp" : "2016-06-30T11:24:31Z", 
    "build_snapshot" : false, 
    "lucene_version" : "5.5.0" 
    }, 
    "tagline" : "You Know, for Search" 
} 

我有RabbitMQ的服務器不同的系統(10.x.x.12)上運行。現在,我試圖連接rabbitmq服務器和elasticsearch,以便發佈在隊列中的所有消息都將被消耗並插入到彈性搜索中。

/etc/logstash/conf.d/rabbit.conf包含

rabbitmq { 
    host => "10.x.x.12" 
    queue => "integration" 
    durable => true 
    key => "#" 
    exchange => "integ" 
    threads => 3 
    prefetch_count => 50 
    port => 5672 
    user => "guest" 
    password => "guest" 
} 

由於插件的問題logstash不來了。

service logstash configtest 
Error: Expected one of #, input, filter, output at line 1, column 1 (byte 1) after {:level=>:error} 

我相信我們需要安裝插件進行彈性搜索。在這個網站中,我沒有看到可用於彈性搜索> 2.0的插件。

有人可以幫助找到apt插件,以便將消息發佈在隊列中。

回答

2

在您的rabbit.conf文件中,您需要將rabbitmq輸入添加到input {}部分。您還需要output{}部分以及elasticsearch輸出將文檔發送到您的ES服務器。

input { 
    rabbitmq { 
    host => "10.x.x.12" 
    queue => "integration" 
    durable => true 
    key => "#" 
    exchange => "integ" 
    threads => 3 
    prefetch_count => 50 
    port => 5672 
    user => "guest" 
    password => "guest" 
    } 
} 
output { 
    elasticsearch { 
     hosts => ["10.x.x.11:9200"] 
     index => "your_index" 
     document_type => "your_type" 
    } 
} 
+0

我們明確需要一個插件嗎?我正在嘗試此操作.. – srinath

+0

默認情況下,'rabbitmq'輸入插件包含在Logstash中。 – Val

+0

哦..是..很好..讓我試試看,並接受答案..謝謝 – srinath