参考样式即可,具体使用配置参数根据实际情况而定

input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost/数据库名"
jdbc_user => "root"
jdbc_password => "password"
jdbc_driver_library => "mysql-connector-java-5.1.45-bin.jar所在位置"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain {charset => "UTF-8"}
record_last_run => true
jdbc_paging_enabled => "true"
jdbc_page_size => "1000"
statement => "sql statement"
schedule => "* * * * *"
type => "数据库表名1"
tags => "数据库表名1"
}
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost/数据库名"
jdbc_user => "root"
jdbc_password => "password"
jdbc_driver_library => "mysql-connector-java-5.1.45-bin.jar所在位置"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain {charset => "UTF-8"}
record_last_run => true
jdbc_paging_enabled => "true"
jdbc_page_size => "1000"
statement => "sql statement"
schedule => "* * * * *"
type => "数据库表名2"
tags => "数据库表名2"
}
} filter {
json {
source => "message"
remove_field => ["message"]
}
} output {
if [type] == "数据库表名1"{
elasticsearch {
hosts => ["els的host地址"]
index => "数据库表名1对应的els的index"
document_id => "%{唯一id}"
}
}
if [type] == "数据库表名2"{
elasticsearch {
hosts => ["els的host地址"]
index => "数据库表名2对应的els的index"
document_id => "%{唯一id}"
}
}
stdout {
codec => json_lines
}
}

最新文章

  1. 未在本地计算机上注册“Microsoft.Jet.OleDb.4.0”提供程序。解决办法
  2. Web应用数据库配置参数读取方法之一
  3. IT菜鸟的3(for循环+分支语句)
  4. iOS UICollectionView 入门 07 点击cell放大图片
  5. DebuggingWithGdb
  6. Js 简单分页(一)
  7. Linux学习笔记6-Linux根目录下各个目录的作用
  8. BZOJ 2038: [2009国家集训队]小Z的袜子(hose)&&莫对算法
  9. VR全景智慧城市搭建掀起实体市场潮流
  10. 使用Dropwizard(2)-配置分类ConfiguredBundle
  11. [编织消息框架][JAVA核心技术]动态代理介绍
  12. RabbitMQ消息队列
  13. 逆元知识普及(进阶篇) ——from Judge
  14. use this method get wifi from notebook
  15. Android中的AlarmManager的使用
  16. python 多个脚本
  17. jpa-入门级测试
  18. Python面试题(十一)
  19. mycat安装
  20. 【遍历二叉树】03二叉树的后序遍历【Binary Tree Postorder Traversal】

热门文章

  1. elasticsearchTemplate that could not be found
  2. CS内网横向移动 模拟渗透实操 超详细
  3. CSS 上下居中和最低高度语法
  4. 使用Python3.7配合协同过滤算法(base on user,基于人)构建一套简单的精准推荐系统(个性化推荐)
  5. npm run dev 启动项目报错我的解决办法
  6. Win10文件、文件夹被占用解决方法
  7. MyBatis 03 缓存
  8. Java注解最全详解(超级详细)
  9. 在 Linux 安装 Java 的流程
  10. [CSP-S 2019 day2 T1] Emiya家今天的饭