input {
jdbc {
jdbc_connection_string => "jdbc:mysql://19.129.325.177:4040/ttt"
jdbc_user => "jwww"
jdbc_password => "******"
jdbc_driver_library => "/home/hadoop/packages/mysql-connector-java-5.1.44.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
# jdbc_paging_enabled => "true"
# jdbc_page_size => "2"
statement => "SELECT * FROM driver limit 4"
# schedule => "*/5 * * * *"
# last_run_metadata_path => ""
}
}
filter {
ruby {
code => "
all = ''
hash = event.to_hash
hash.each do |k,v|
if v == nil
event.set(k, '')
v = ''
end
all += k + '=' + v.to_s + '|'
end
event.set('all', all)"
}
}
output {
stdout {
codec => rubydebug{}
}
# webhdfs {
# host => "113.21.61.114"
# port => 50070
# path => "/test/logstash/hive/dt=%{+YYYY-MM-dd}/logstash-%{+HH}.log"
# user => "hdfs"
# codec => plain {
# format => "%{all}"
# }
# }
}
logstash ruby 插件高级用法
最新推荐文章于 2023-02-11 21:52:30 发布