Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. input{
  2.  
  3. jdbc {
  4. jdbc_driver_library => "/home/user/logstash/mysql-connector-java-5.1.17-bin.jar"
  5.  
  6. jdbc_driver_class => "com.mysql.jdbc.Driver"
  7.  
  8. jdbc_connection_string => "jdbc:mysql://[remotehostipnumber]/databasename"
  9.  
  10. jdbc_validate_connection => true
  11.  
  12. jdbc_user => "username"
  13.  
  14. jdbc_password => "password"
  15.  
  16. schedule => "* * * * *"
  17.  
  18. statement => "select * from table"
  19.  
  20. }
  21.  
  22. }
  23.  
  24. output
  25.  
  26. {
  27. elasticsearch
  28. {
  29.  
  30. index => "tables"
  31. document_type => "table"
  32. document_id => "%{table_id}"
  33. hosts => "localhost:9200"
  34. }stdout { codec => json_lines }
  35. }
  36.  
  37. sudo /opt/logstash/bin/logstash --configtest -f /home/user/logstash/logstash.conf
  38.  
  39. Settings: Default filter workers: 1
  40. Logstash startup completed
  41.  
  42. curl -XGET 'localhost:9200/tables/table/_search?pretty=true'
  43.  
  44. {
  45. "error" : {
  46. "root_cause" : [ {
  47. "type" : "index_not_found_exception",
  48. "reason" : "no such index",
  49. "resource.type" : "index_or_alias",
  50. "resource.id" : "tables",
  51. "index" : "table"
  52. } ],
  53. "type" : "index_not_found_exception",
  54. "reason" : "no such index",
  55. "resource.type" : "index_or_alias",
  56. "resource.id" : "tables",
  57. "index" : "tables"
  58. },
  59. "status" : 404
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement