Created
June 25, 2019 15:27
-
-
Save vector4wang/d2ccacac41cb33d23109cfd19eb82295 to your computer and use it in GitHub Desktop.
[Logstash filter use http] #Logstash #Http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
jdbc { | |
jdbc_driver_library => "/Users/wangxc/Develop/maven/repo/mysql/mysql-connector-java/5.1.46/mysql-connector-java-5.1.46.jar" | |
jdbc_driver_class => "com.mysql.jdbc.Driver" | |
jdbc_connection_string => "jdbc:mysql://localhost:3308/test" | |
jdbc_user => "root" | |
jdbc_password => "123456" | |
statement => "SELECT * FROM account" | |
} | |
} | |
filter { | |
mutate { | |
add_field => {"username" => "%{name}"} | |
} | |
rest { | |
request => { | |
url => "http://localhost:8081/log/show2" | |
method => "post" | |
body => { "id" => "%{username}" "name" => "%{password}" } | |
} | |
target => "weather" | |
} | |
} | |
output { | |
stdout { | |
codec => rubydebug{} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment