【问题标题】:Config file for importing data from multiple couchdb databases Logstash用于从多个 couchdb 数据库 Logstash 导入数据的配置文件
【发布时间】:2015-11-15 20:06:24
【问题描述】:

我们将数据类型存储在 couchdb 中的每个数据库中。配置文件必须以何种格式从多个数据库中导入数据?或者我是否需要多个配置文件来将每个数据库中的数据导入索引。将不胜感激。

谢谢。

【问题讨论】:

    标签: node.js elasticsearch couchdb logstash


    【解决方案1】:

    我们为多个数据库使用一个配置文件。

    它并不完美,但现在可以使用。

    目前的样子:

    input { 
      couchdb_changes {
        sequence_path => "db1.seq"
        db => "db1"
        host => "xxx.xxx.xxx.xxx"
        username => "xxx"
        password => "xxx"
        add_field => {
           "organization" => "db1"
        }
      }
      couchdb_changes {
        sequence_path => "db2.seq"
        db => "db2"
        host => "xxx.xxx.xxx.xxx"
        username => "xxx"
        password => "xxx"
        add_field => {
           "organization" => "db2"
        }
      }
    } 
    
    filter {
      mutate {
        remove_field => [ "_attachments" ]
      }
    }
    
    output { 
      stdout { codec => rubydebug } 
    
      elasticsearch { 
        cluster => "cluster0"
        host => ["xxx.xxx.xxx.xxx", "xxx.xxx.xxx.xxx", "xxx.xxx.xxx.xxx"] 
        protocol => "http" 
        index => "%{[organization]}" 
        document_id => "%{[@metadata][_id]}"
      } 
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-23
      • 1970-01-01
      相关资源
      最近更新 更多