Skip to content

Instantly share code, notes, and snippets.

@agastya71
Last active September 14, 2015 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agastya71/9097d9f494e79dea4095 to your computer and use it in GitHub Desktop.
Save agastya71/9097d9f494e79dea4095 to your computer and use it in GitHub Desktop.
http_poller_input config :
Reading config file {:file=>"logstash/agent.rb", :level=>:debug, :line=>"301", :method=>"local_config"}
Compiled pipeline code:
@inputs = []
@filters = []
@outputs = []
@periodic_flushers = []
@shutdown_flushers = []
@input_http_poller_1 = plugin("input", "http_poller", LogStash::Util.hash_merge_many({ "urls" => {("url_to_test") => {("url") => ("http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"), ("keepalive") => ("false"), ("method") => ("get"), ("cookies") => ("false"), ("automatic_retries") => 1}} }, { "connect_timeout" => 15 }, { "request_timeout" => 120 }, { "interval" => 60 }, { "socket_timeout" => 60 }, { "codec" => ("json") }, { "metadata_target" => ("http_poller_metadata") }))
@inputs << @input_http_poller_1
@output_stdout_2 = plugin("output", "stdout", LogStash::Util.hash_merge_many({ "codec" => ("rubydebug") }))
@outputs << @output_stdout_2
def filter_func(event)
events = [event]
@logger.debug? && @logger.debug("filter received", :event => event.to_hash)
events
end
def output_func(event)
@logger.debug? && @logger.debug("output received", :event => event.to_hash)
@output_stdout_2.handle(event)
end {:level=>:debug, :file=>"logstash/pipeline.rb", :line=>"28", :method=>"initialize"}
Plugin not defined in namespace, checking for plugin file {:type=>"input", :name=>"http_poller", :path=>"logstash/inputs/http_poller", :level=>:debug, :file=>"logstash/plugin.rb", :line=>"133", :method=>"lookup"}
Plugin not defined in namespace, checking for plugin file {:type=>"codec", :name=>"json", :path=>"logstash/codecs/json", :level=>:debug, :file=>"logstash/plugin.rb", :line=>"133", :method=>"lookup"}
Using version 0.1.x codec plugin 'json'. This plugin isn't well supported by the community and likely has no maintainer. {:level=>:info, :file=>"logstash/config/mixin.rb", :line=>"223", :method=>"print_version_notice"}
config LogStash::Codecs::JSON/@charset = "UTF-8" {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@urls = {"url_to_test"=>{"url"=>"http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName", "keepalive"=>"false", "method"=>"get", "cookies"=>"false", "automatic_retries"=>1}} {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@connect_timeout = 15 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@request_timeout = 120 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@interval = 60 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@socket_timeout = 60 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@codec = <LogStash::Codecs::JSON charset=>"UTF-8"> {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@metadata_target = "http_poller_metadata" {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@debug = false {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@add_field = {} {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@follow_redirects = true {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@pool_max = 50 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@pool_max_per_route = 25 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@keepalive = true {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@automatic_retries = 0 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@ssl_certificate_validation = true {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@truststore_type = "JKS" {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Inputs::HTTP_Poller/@cookies = true {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
Plugin not defined in namespace, checking for plugin file {:type=>"output", :name=>"stdout", :path=>"logstash/outputs/stdout", :level=>:debug, :file=>"logstash/plugin.rb", :line=>"133", :method=>"lookup"}
Using version 0.1.x output plugin 'stdout'. This plugin isn't well supported by the community and likely has no maintainer. {:level=>:info, :file=>"logstash/config/mixin.rb", :line=>"223", :method=>"print_version_notice"}
Plugin not defined in namespace, checking for plugin file {:type=>"codec", :name=>"rubydebug", :path=>"logstash/codecs/rubydebug", :level=>:debug, :file=>"logstash/plugin.rb", :line=>"133", :method=>"lookup"}
Using version 0.1.x codec plugin 'rubydebug'. This plugin isn't well supported by the community and likely has no maintainer. {:level=>:info, :file=>"logstash/config/mixin.rb", :line=>"223", :method=>"print_version_notice"}
config LogStash::Codecs::RubyDebug/@metadata = false {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Outputs::Stdout/@codec = <LogStash::Codecs::RubyDebug > {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Outputs::Stdout/@type = "" {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Outputs::Stdout/@tags = [] {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Outputs::Stdout/@exclude_tags = [] {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
config LogStash::Outputs::Stdout/@workers = 1 {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
Registering http_poller Input {:type=>nil, :urls=>{"url_to_test"=>{"url"=>"http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName", "keepalive"=>"false", "method"=>"get", "cookies"=>"false", "automatic_retries"=>1}}, :interval=>60, :timeout=>nil, :level=>:info, :file=>"logstash/inputs/http_poller.rb", :line=>"71", :method=>"register"}
Pipeline started {:level=>:info, :file=>"logstash/pipeline.rb", :line=>"86", :method=>"run"}
Logstash startup completed
Fetching URL {:name=>"url_to_test", :url=>[:get, "http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName", {:keepalive=>"false", :cookies=>"false", :automatic_retries=>1}], :level=>:debug, :file=>"logstash/inputs/http_poller.rb", :line=>"143", :method=>"request_async"}
output received {:event=>{"timestamp"=>1442247750, "status"=>200, "request"=>{"mbean"=>"example.package.name:type=Registrar", "attribute"=>"InstanceName", "type"=>"read"}, "value"=>"java_app_name", "@version"=>"1", "@timestamp"=>"2015-09-14T16:22:30.419Z", "http_poller_metadata"=>{"name"=>"url_to_test", "host"=>"http_poller_host", "request"=>{"keepalive"=>"false", "cookies"=>"false", "automatic_retries"=>1, "method"=>"get", "url"=>"http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"}, "runtime_seconds"=>0.212, "code"=>200, "response_headers"=>{"cache-control"=>"no-cache", "content-type"=>"text/plain; charset=utf-8", "expires"=>"Mon, 14 Sep 2015 15:22:30 GMT", "content-length"=>"194", "pragma"=>"no-cache", "date"=>"Mon, 14 Sep 2015 16:22:30 GMT"}, "response_message"=>"OK", "times_retried"=>0}}, :level=>:debug, :file=>"(eval)", :line=>"21", :method=>"output_func"}
{
"timestamp" => 1442247750,
"status" => 200,
"request" => {
"mbean" => "example.package.name:type=Registrar",
"attribute" => "InstanceName",
"type" => "read"
},
"value" => "java_app_name",
"@version" => "1",
"@timestamp" => "2015-09-14T16:22:30.419Z",
"http_poller_metadata" => {
"name" => "url_to_test",
"host" => "http_poller_host",
"request" => {
"keepalive" => "false",
"cookies" => "false",
"automatic_retries" => 1,
"method" => "get",
"url" => "http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"
},
"runtime_seconds" => 0.212,
"code" => 200,
"response_headers" => {
"cache-control" => "no-cache",
"content-type" => "text/plain; charset=utf-8",
"expires" => "Mon, 14 Sep 2015 15:22:30 GMT",
"content-length" => "194",
"pragma" => "no-cache",
"date" => "Mon, 14 Sep 2015 16:22:30 GMT"
},
"response_message" => "OK",
"times_retried" => 0
}
}
Fetching URL {:name=>"url_to_test", :url=>[:get, "http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName", {:keepalive=>"false", :cookies=>"false", :automatic_retries=>1}], :level=>:debug, :file=>"logstash/inputs/http_poller.rb", :line=>"143", :method=>"request_async"}
output received {:event=>{"@version"=>"1", "@timestamp"=>"2015-09-14T16:23:29.968Z", "http_poller_metadata"=>{"name"=>"url_to_test", "host"=>"http_poller_host", "request"=>{"keepalive"=>"false", "cookies"=>"false", "automatic_retries"=>1, "method"=>"get", "url"=>"http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"}, "runtime_seconds"=>nil}, "tags"=>["_http_request_failure"], "http_request_failure"=>{"request"=>{"keepalive"=>"false", "cookies"=>"false", "automatic_retries"=>1, "method"=>"get", "url"=>"http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"}, "name"=>"url_to_test", "error"=>"app.server.name:10710 failed to respond", "backtrace"=>nil, "runtime_seconds"=>0.015}}, :level=>:debug, :file=>"(eval)", :line=>"21", :method=>"output_func"}
{
"@version" => "1",
"@timestamp" => "2015-09-14T16:23:29.968Z",
"http_poller_metadata" => {
"name" => "url_to_test",
"host" => "http_poller_host",
"request" => {
"keepalive" => "false",
"cookies" => "false",
"automatic_retries" => 1,
"method" => "get",
"url" => "http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"
},
"runtime_seconds" => nil
},
"tags" => [
[0] "_http_request_failure"
],
"http_request_failure" => {
"request" => {
"keepalive" => "false",
"cookies" => "false",
"automatic_retries" => 1,
"method" => "get",
"url" => "http://app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"
},
"name" => "url_to_test",
"error" => "app.server.name:10710 failed to respond",
"backtrace" => nil,
"runtime_seconds" => 0.015
}
}
input {
http_poller {
urls => {
url_to_test => {
url => "http:/app.server.name:10710/jolokia/read/example.package.name:type=Registrar/InstanceName"
keepalive => false
method => get
cookies => false
automatic_retries => 1
}
}
connect_timeout => 15
request_timeout => 30
interval => 60
socket_timeout => 60
codec => "json"
# A hash of request metadata info (timing, response headers, etc.) will be sent here
metadata_target => "http_poller_metadata"
}
}
output {
# Use stdout in debug mode again to see what logstash makes of the event.
stdout {
# debug => true
codec => "rubydebug"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment