zoukankan      html  css  js  c++  java
  • logstash 数据库配置文件

    验证通过

    文件名:sqlserver.conf

    input {
    stdin {
    }
    jdbc {
    jdbc_connection_string => "jdbc:sqlserver://localhost:1433;databaseName=Test"
    # the user we wish to excute our statement as
    jdbc_user => "sa"
    jdbc_password => "123456"
    # the path to our downloaded jdbc driver
    jdbc_driver_library => "D:/elasticsearch/logstash-6.2.1/sqlserver/sqljdbc42.jar"
    # the name of the driver class for mysql
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_paging_enabled => "true"
    jdbc_page_size => "50000"
    #要执行的sql文件
    #statement_filepath => "/conf/course.sql"
    statement => "select name,description,studymodel from dbo.xc_course"
    #定时配置
    schedule => "* * * * *"
    record_last_run => true
    last_run_metadata_path => "D:/elasticsearch/logstash-6.2.1/config/logstash_metadata"
    }
    }


    output {
    elasticsearch {
    #ESIP地址与端口
    #hosts => "localhost:9200"
    hosts => ["localhost:9200"]
    #ES索引名称(自己定义的)
    index => "xc_course"
    #自增ID编号
    document_type => "doc"
    template =>"D:/elasticsearch/logstash-6.2.1/config/xc_course_template.json"
    template_name =>"xc_course"
    template_overwrite =>"true"
    }
    }

    ----------------------------------------------------------------------------------------------------

    {
    "mappings" : {
    "xc_course" : {
    "_source" : {

    },
    "properties" : {

    "description" : {
    "type" : "text"
    },
    "name" : {
    "type" : "text"
    },
    "studymodel" : {
    "type" : "keyword"
    }
    }
    }
    },
    "order" : 0,
    "template" : "xc_course"
    }

  • 相关阅读:
    习题8-8 判断回文字符串
    Field笔记
    Object类中的方法
    字符和字节的区别
    Layui搜索设置每次从第一页开始
    Springboot+Jpa+Layui使用Pageable工具进行数据分页
    Map<String, Object>返回类型
    List集合中剔除重复的数据
    Springboot+Mybatis(Mysql 、Oracle) 注解和使用Xml两种方式批量添加数据
    MySql中group_concat函数的使用
  • 原文地址:https://www.cnblogs.com/zhoading/p/12570623.html
Copyright © 2011-2022 走看看