Guest User

Untitled

a guest
Jun 16th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. Here is poll3.conf
  2.  
  3. input {
  4. http_poller {
  5. urls => {
  6. test2 => {
  7. method => get
  8. url => "http://localhost:9200/_cluster/health"
  9. }
  10. }
  11. interval => 60
  12. }
  13. }
  14.  
  15. filter {}
  16.  
  17. output {
  18. stdout { codec => rubydebug { metadata => true } }
  19. }
  20. ==========================================================================================================
  21. Here is poll4.conf (the only difference is the reference to the env).
  22. input {
  23. http_poller {
  24. urls => {
  25. test2 => {
  26. method => get
  27. url => "http://${CONDUCTOR_IP}:9200/_cluster/health"
  28. }
  29. }
  30. interval => 60
  31. }
  32. }
  33.  
  34. filter {}
  35.  
  36. output {
  37. stdout { codec => rubydebug { metadata => true } }
  38. }
  39.  
  40.  
  41. ==========================================================================================================
  42.  
  43. Here is a configuration that does work with env
  44. input {
  45.  
  46. http_poller {
  47. urls => { "test2" => "http://${CONDUCTOR_IP}:8080/Fred.txt" }
  48. interval => 30
  49. }
  50.  
  51. }
  52.  
  53. filter {
  54. }
  55.  
  56. output {
  57. stdout { codec => rubydebug { metadata => true } }
  58. }
  59.  
  60. ==========================================================================================================
  61.  
  62.  
  63. logstash-2.3.2]$ CONDUCTOR_IP=127.0.0.1 bin/logstash --allow-env -f ~/elk/configs/poll3.conf
  64. Settings: Default pipeline workers: 4
  65. Pipeline main started
  66. {
  67. "cluster_name" => "elasticsearch",
  68. "status" => "yellow",
  69. "timed_out" => false,
  70. "number_of_nodes" => 1,
  71. <snip>
  72. "response_message" => "OK",
  73. "times_retried" => 0
  74. }
  75. }
  76. ^CSIGINT received. Shutting down the agent. {:level=>:warn}
  77. stopping pipeline {:id=>"main"}
  78. Pipeline main has been shutdown
  79.  
  80. ==========================================================================================================
  81.  
  82.  
  83. logstash-2.3.2]$ CONDUCTOR_IP=127.0.0.1 bin/logstash --allow-env -f ~/elk/configs/poll4.conf
  84. Settings: Default pipeline workers: 4
  85. Pipeline aborted due to error {:exception=>#<LogStash::ConfigurationError: Invalid URL http://${CONDUCTOR_IP}:9200/_cluster/health>, :backtrace=>["/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-input-http_poller-2.0.6/lib/logstash/inputs/http_poller.rb:119:in `validate_request!'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-input-http_poller-2.0.6/lib/logstash/inputs/http_poller.rb:111:in `normalize_request'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-input-http_poller-2.0.6/lib/logstash/inputs/http_poller.rb:88:in `setup_requests!'", "org/jruby/RubyHash.java:1342:in `each'", "org/jruby/RubyEnumerable.java:757:in `map'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-input-http_poller-2.0.6/lib/logstash/inputs/http_poller.rb:88:in `setup_requests!'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-input-http_poller-2.0.6/lib/logstash/inputs/http_poller.rb:79:in `register'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:330:in `start_inputs'", "org/jruby/RubyArray.java:1613:in `each'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:329:in `start_inputs'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:180:in `start_workers'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/pipeline.rb:136:in `run'", "/home/anelson/elk/logstash-2.3.2/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.2-java/lib/logstash/agent.rb:465:in `start_pipeline'"], :level=>:error}
  86. ^CSIGINT received. Shutting down the agent. {:level=>:warn}
  87. stopping pipeline {:id=>"main"}
  88.  
  89. ==========================================================================================================
  90.  
  91. logstash-2.3.2]$ CONDUCTOR_IP=127.0.0.1 bin/logstash --allow-env -f ~/elk/configs/env.conf
  92. Settings: Default pipeline workers: 4
  93. Pipeline main started
  94. {
  95. "message" => "Fred loves Wilma, but cheats with Betty.\n",
  96. "tags" => [
  97. [0] "_jsonparsefailure"
  98. ],
  99. "@version" => "1",
  100. "@timestamp" => "2016-06-16T22:38:24.390Z",
  101. "@metadata" => {
  102. "name" => "test2",
  103. "host" => "localhost.localdomain",
  104. "request" => {
  105. "method" => "get",
  106. "url" => "http://127.0.0.1:8080/Fred.txt"
  107. },
  108. "runtime_seconds" => 0.489,
  109. "code" => 200,
  110. "response_headers" => {
  111. "content-length" => "41",
  112. "date" => "Thu, 16 Jun 2016 22:38:24 GMT",
  113. "age" => "0"
  114. },
  115. "response_message" => "",
  116. "times_retried" => 0
  117. }
  118. }
  119. ^CSIGINT received. Shutting down the agent. {:level=>:warn}
Add Comment
Please, Sign In to add comment