Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input {
- jdbc {
- jdbc_driver_library => "E:ELK 6.22logstash-6.2.2binmysql-connector-java-5.1.45-bin.jar"
- jdbc_driver_class => "com.mysql.jdbc.Driver"
- jdbc_connection_string => "jdbc:mysql://localhost:3306/fbk"
- jdbc_user => "root"
- jdbc_password => ""
- statement => "SELECT fbk_repeat._URI AS URI, _SUBMISSION_DATE AS SUBMISSION_DATE, DEVICEID, LOCATION_LAT, LOCATION_LNG, SECTOR, COMMENTS, ACTION_TAKEN, PURPOSE
- FROM
- fbk_core
- INNER JOIN fbk_repeat ON fbk_core._URI = fbk_repeat._PARENT_AURI"
- }
- }
- filter {
- # mutate { convert => {"LOCATION_LAT" => "float"} }
- # mutate { convert => {"LOCATION_LNG" => "float"} }
- # mutate { rename => {"LOCATION_LAT" => "[location][lat]"} }
- # mutate { rename => {"LOCATION_LNG" => "[location][lon]"} }
- mutate {
- # Location and lat/lon should be used as is, this is as per logstash documentation
- # Here we are tying to create a two-dimensional array in order to save data as per Logstash documentation
- add_field => { "[location][lat]" => [ "%{LOCATION_LAT}" ] }
- add_field => { "[location][lon]" => [ "%{LOCATION_LNG}" ] }
- convert => [ "[location]", "float" ]
- }
- # date {
- # locale => "eng"
- # match => ["_SUBMISSION_DATE", "yyyy-MM-dd HH:mm:ss", "ISO8601"]
- # target => "SUBMISSION_DATE"
- # }
- }
- output{
- elasticsearch {
- hosts => ["localhost:9200"]
- index => "feedback"
- document_id => "%{URI}"
- document_type => "feedbackdata"
- manage_template => true
- # user => "elastic"
- # password => "changeme"
- }
- stdout { codec => rubydebug { metadata => true } }
- # stdout { codec => dots }
- }
Add Comment
Please, Sign In to add comment