logstash 7配置jdbc插件

logstash.jpg

环境

  • logstash-7.1.1.rpm;
  • elasticsearch-7.1.1-linux-x86_64.tar.gz;

配置

1.配置文件

input {
  jdbc {
    jdbc_driver_library => "/home/inspur/elasticsearch/lib/ojdbc6.jar"
    jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
    jdbc_connection_string => "jdbc:oracle:thin:@10.47.0.238:1521:orcl"
    jdbc_user => "lgzr"
    jdbc_password => "lgzr"
    statement => "select * from SR_INFOR t"
    clean_run => true
  }
}

output {
   elasticsearch {
      hosts => ["10.47.0.96:9200"]
      index => "data_archives_jdbc"
   }
}

2.测试配置文件

sudo /usr/share/logstash/bin/logstash  -f /etc/logstash/conf.d/ --config.test_and_exit --path.settings=/etc/logstash

启动logstash

sudo /usr/share/logstash/bin/logstash  -f /etc/logstash/conf.d/ --path.settings=/etc/logstash

进阶

更详细的配置,参考我的这篇文章:记一次logstash 7配置jdbc插件使用实践

赞(1)
未经允许禁止转载:优米格 » logstash 7配置jdbc插件

评论 抢沙发

合作&反馈&投稿

商务合作、问题反馈、投稿,欢迎联系

广告合作侵权联系