Guest User

Untitled

a guest
Feb 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. input {
  2. jdbc {
  3. jdbc_driver_library => "E:ELK 6.22logstash-6.2.2binmysql-connector-java-5.1.45-bin.jar"
  4. jdbc_driver_class => "com.mysql.jdbc.Driver"
  5. jdbc_connection_string => "jdbc:mysql://localhost:3306/fbk"
  6. jdbc_user => "root"
  7. jdbc_password => ""
  8. statement => "SELECT fbk_repeat._URI AS URI, _SUBMISSION_DATE AS SUBMISSION_DATE, DEVICEID, LOCATION_LAT, LOCATION_LNG, SECTOR, COMMENTS, ACTION_TAKEN, PURPOSE
  9. FROM
  10. fbk_core
  11. INNER JOIN fbk_repeat ON fbk_core._URI = fbk_repeat._PARENT_AURI"
  12. }
  13. }
  14.  
  15.  
  16.  
  17. filter {
  18.  
  19. # mutate { convert => {"LOCATION_LAT" => "float"} }
  20. # mutate { convert => {"LOCATION_LNG" => "float"} }
  21. # mutate { rename => {"LOCATION_LAT" => "[location][lat]"} }
  22. # mutate { rename => {"LOCATION_LNG" => "[location][lon]"} }
  23.  
  24. mutate {
  25. # Location and lat/lon should be used as is, this is as per logstash documentation
  26. # Here we are tying to create a two-dimensional array in order to save data as per Logstash documentation
  27.  
  28. add_field => { "[location][lat]" => [ "%{LOCATION_LAT}" ] }
  29. add_field => { "[location][lon]" => [ "%{LOCATION_LNG}" ] }
  30. convert => [ "[location]", "float" ]
  31. }
  32.  
  33.  
  34. # date {
  35. # locale => "eng"
  36. # match => ["_SUBMISSION_DATE", "yyyy-MM-dd HH:mm:ss", "ISO8601"]
  37. # target => "SUBMISSION_DATE"
  38. # }
  39.  
  40. }
  41.  
  42. output{
  43. elasticsearch {
  44. hosts => ["localhost:9200"]
  45. index => "feedback"
  46. document_id => "%{URI}"
  47. document_type => "feedbackdata"
  48. manage_template => true
  49.  
  50. # user => "elastic"
  51. # password => "changeme"
  52.  
  53.  
  54. }
  55. stdout { codec => rubydebug { metadata => true } }
  56. # stdout { codec => dots }
  57. }
Add Comment
Please, Sign In to add comment