zoukankan      html  css  js  c++  java
  • logstash同步mongodb数据到elasticsearch

    一、安装logstash

    二、安装mongodb插件

    cd D:SoftwareELK5.5.0logstash-5.5.0in

    logstash-plugin install logstash-output-mongodb

    logstash-plugin install logstash-input-mongodb

     要先装output再装input,不然会报mongo版本冲突

    D:SoftwareELK5.5.0logstash-5.5.0inmongoproductinfo.conf配置文件如下:

    input {
      mongodb {
        uri => "mongodb://username:password@192.168.1.111:7001/Mall_search?ssl=false"
        placeholder_db_dir => "D:optlogstash-mongodb"
        placeholder_db_name => "eb_search_mongo.db"
        collection => "ProductInfo_ObjectId"
        batch_size => 5
        type => "product"    
      }
    }
    filter {
    mutate {
    remove_field => [ "_id" ]
    }
    }
    
    output {
        elasticsearch {
            hosts => ["192.168.1.58:9200"]
            index => "sync_mongo_productinfo_201801166666677"
            document_id => "%{ProductID}"        
        }
        stdout { codec => rubydebug }
    }

    启动命令:

    cd D:SoftwareELK5.5.0logstash-5.5.0in

    .logstash.bat -f  .mongoproductinfo.conf

  • 相关阅读:
    class 关键字
    自适应Web主页
    前端跨域解决
    HTML5新增特性
    HTTP知识点【总结篇】
    针对Web应用的【攻击模式篇】
    HTTPS和HTTP
    HTTP状态码之【整理篇】
    SpringCloud配制eureka
    maven连接国内仓库
  • 原文地址:https://www.cnblogs.com/a-du/p/8298418.html
Copyright © 2011-2022 走看看