Elasticsearch 的 Logstash couchdb_changes 插件

Elasticsearch's Logstash couchdb_changes Plugin

Github 的 CouchDB River Plugin for Elasticsearch 页面说:"Rivers are deprecated and will be removed in the future. Have a look at logstash couchdb changes input."

我明白,如果我没记错的话,我必须使用 couchdb_changes 插件。 如何使用 couchdb_changes 将文档从 CouchDB 索引到 Elasticsearch? 这可以在 PHP 中完成吗?

Logstash 不适用于 PHP。如果你想使用 PHP,那么你需要编写自己的从 CouchDB 到 ES 的托运人。做好这件事并非易事。

此外,Logstash 是一个代表管道的独立应用程序:一个输入、一个称为过滤器的修改器(如果需要)和一个输出。在您的情况下,输入将使用 couchdb_changes plugin and the output would use the elasticsearch plugin.

这是来自 Logstash 的一个非常简单的准系统示例。注意:Logstash 使用 Ruby 语法。

input {
  couchdb_changes {
    db => "yourdbinfo"
    host => "10.0.0.1"
    # if you have a user/password
    username => nil
    password => nil
  }
}

filter {
  # May not need to change anything
}

output {
  elasticsearch {
    protocol => "http"
    host => "10.0.0.2"
    index => "your-index"
    document_type => "your-type"
  }
}