🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` input { stdin { } jdbc { #注意mysql连接地址一定要用ip,不能使用localhost等 jdbc_connection_string => "jdbc:mysql://120.76.77.105:30020/siyu-cloud" jdbc_user => "root" jdbc_password => "51242211541qqsdfsdf" #这个jar包的地址是容器内的地址 jdbc_driver_library => "/etc/logstash/pipeline/mysql-connector-java-8.0.19.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" jdbc_paging_enabled => "true" jdbc_page_size => "5000" statement => "SELECT id from user" schedule => "* * * * *" } } filter { ruby { code => "event.set('timestamp', event.get('@timestamp').time.localtime + 8*60*60)" } ruby { code => "event.set('@timestamp',event.get('timestamp'))" } mutate { remove_field => ["timestamp"] } } output { stdout { codec => json_lines } elasticsearch { #注意mysql连接地址一定要用ip,不能使用localhost等 hosts => "192.168.67.148:9200" index => "table_sys_roledata" document_type => "_doc" document_id => "%{id}" } } ```