How to install http_pollar plugin manually in Logstash?


(R01K) #1

How to install http_pollar plugin manually in Logstash?


(Magnus B├Ąck) #2

Not sure exactly what you mean by manual, but the second paragraph of the plugin documentation says

This plugin does not ship with Logstash by default, but it is easy to install by running bin/plugin install logstash-input-http_poller.

Doesn't that work for you?


(R01K) #3

we have already tried this command but our proxy is not allowing us to install this plugin form web.
So we have tried installing plugin using manual steps listed in Github (and installation is successful now) but still showing the error as given below

[ServerName~bin]$ ./plugin install /elkt/software/logstash-input-http_poller-master/logstash-input-http_poller-1.1.2.gem
Validating /elkt/software/logstash-input-http_poller-master/logstash-input-http_poller-1.1.2.gem
Installing logstash-input-http_poller
Installation successful
[Server Name~bin]$ ./logstash -f http_pollar.conf
The error reported is:

Couldn't find any input plugin named 'http_poller'. Are you sure this is correct? Trying to load the http_poller input plugin resulted in this error: no such file to load -- logstash/inputs/http_poller


How to install http_pollar plugin manually?
(Muratagenc) #4

you must download the gem file from: https://rubygems.org/gems/logstash-input-http_poller/versions/2.0.2
permission problem with Gemfile under /logstash? solution;
chmod o+w Gemfile

then swicth to root and install;
root@dpsubuntuazure:/opt/logstash# ./bin/plugin install logstash-input-http_poller-2.0.2.gem
Validating logstash-input-http_poller-2.0.2.gem
Installing logstash-input-http_poller
Installation successful

done!

testing http_poller
the config file:

input {
http_poller {
urls => {
test1 => "http://localhost:9200"
test2 => {
# Supports all options supported by ruby's Manticore HTTP client
method => get
url => "http://localhost:9200/_cluster/health"
headers => {
Accept => "application/json"
}
auth => {
user => "AzureDiamond"
password => "hunter2"
}
}
}
request_timeout => 60
interval => 60
codec => "json"
# A hash of request metadata info (timing, response headers, etc.) will be sent here
metadata_target => "http_poller_metadata"
}
}

output {
stdout {
codec => rubydebug
}
}

test command:
./logstash -f logstash_test.conf

output:
Default settings used: Filter workers: 1
Logstash startup completed
{
"cluster_name" => "elasticsearch",
"status" => "yellow",
"timed_out" => false,
"number_of_nodes" => 1,
"number_of_data_nodes" => 1,
"active_primary_shards" => 16,
"active_shards" => 16,
"relocating_shards" => 0,
"initializing_shards" => 0,
"unassigned_shards" => 16,
"delayed_unassigned_shards" => 0,
"number_of_pending_tasks" => 0,
"number_of_in_flight_fetch" => 0,
"task_max_waiting_in_queue_millis" => 0,
"active_shards_percent_as_number" => 50.0,
"@version" => "1",
"@timestamp" => "2015-11-12T01:24:01.469Z",
"http_poller_metadata" => {
"name" => "test2",
"host" => "dpsubuntuazure",
"request" => {
"headers" => {
"Accept" => "application/json"
},
....


(R01K) #5

Thanks !


(system) #6