标签:lines 技术分享 img 文件 color value inpu char 下载地址
下载地址
https://artifacts.elastic.co/downloads/logstash/logstash-5.6.8.zip
下载后解压,测试
#将键盘内容输出到控制台 logstash -e ‘input { stdin { } } output { stdout {}}‘
从文件中读取配置,然后连接mysql然后输出到es
新建 mysqletc 文件夹
input{ jdbc { jdbc_driver_library => "D:\download\logstash-5.6.8\mysqletc\mysql-connector-java-5.1.47.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/tensquare_article?useUnicode=true&characterEncoding=UTF8" jdbc_user => "root" jdbc_password => "1234" jdbc_paging_enabled => "true" jdbc_page_size => "50" jdbc_default_timezone =>"Asia/Shanghai" #都为*每分钟都执行 schedule => "* * * * *" statement => "SELECT id,title,content,state FROM tb_article" use_column_value => true tracking_column => "updatetime" } } output{ elasticsearch { hosts => "127.0.0.1:9200" index => "tensquare" document_id => "%{id}" document_type => "article" } stdout { #以json格式输出 codec => json_lines } }
测试
logstash -f ../mysqletc/mysql.conf
标签:lines 技术分享 img 文件 color value inpu char 下载地址
原文地址:https://www.cnblogs.com/dongma/p/10017839.html