mongodb和弹性搜索之间的实时同步

时间:2018-12-13 13:33:26

标签: mongodb elasticsearch logstash kibana elastic-stack

使用Logstash-input-mongodb能够实时插入记录。但是,当涉及更新时,这并没有按预期进行。有人可以指导我吗?

logstash-mongodb.conf

input {
    mongodb {
        uri => 'mongodb://127.0.0.1:27017/test-db'
        placeholder_db_dir => '/opt/logstash-mongodb/'
        placeholder_db_name => 'logstash_sqlite.db'
        collection => 'mycol'
        batch_size => 5000
        generateId => true
    }
}
filter{
    mutate { remove_field => "_id" }
}

output {
    elasticsearch {
        hosts => [ "http://localhost:9200" ]
        index => "test-index"
    }
}

0 个答案:

没有答案