Pipeline cannot start with http_poller

Hi
I've installed v6.0 and get a problem when using input http_poller because the pipeline crashes when starting up and the output that I get is:

Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"NoMethodError", :message=>"undefined method ``get' for #<Hash:0x7e616f62>\nDid you mean? gem"

My configuration looks like this and I cannot figure out what the problem is and why it is complaining about method:

  http_poller {
    urls => {
      dev => {
        method => get
        url => "..."
        headers => {
          Accept => "application/json"
        }
      }
    }
    request_timeout => 60
	schedule => { "every" => "10s"}
    codec => "json"
    metadata_target => "http_poller_metadata"
  }

Regards
Tonni

Did you find solution ?

No I haven't. Any idea on what could be the problem?

I tried with logstash 5.0 and it's work fine :frowning:

Can reproduce :confused:

My error looks slightly different, though:

The given configuration is invalid. Reason: undefined method `get' for {"url"=>"..."}:hash:
Did you mean?  gem

With this configuration:

input {
    http_poller {
        urls => {
            localhost => {
                url => "..."
            }
        }
        codec => "json_lines"
        schedule => { every => "60s" }
        metadata_target => "[@metadata][http_poller]"
    }
}

Hi,
I have the same problem with logstash v6.0 with this code :

input {
    http_poller {
        urls => {
            test => {
                method => get
                headers => {
                    Accept => "application/json"
                }
                url => "http://localhost:9200/_cluster/health"
            }
        }
        request_timeout => 60
        schedule => { in => "1s"}
        codec => "json"
    }
}
filter{}
output {
    stdout {
        codec => rubydebug
    }
}

This code was written based on the exemple on : https://www.elastic.co/guide/en/logstash/6.0/plugins-inputs-http_poller.html

And the error is :

Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"NoMethodError", :message=>"undefined method `get' for {"Accept"=>"application/json"}:Hash\nDid you mean? gem",

Like you I don't understand what is the problem but maybe this example can help to reproduce the problem for elastic team members.

Even I've the same problem.

Blockquote

[2017-11-22T17:14:28,097][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"NoMethodError", :message=>"undefined method `get' for #Hash:0x4359aa3f\nDid you mean? gem",

Blockquote

I had this exact issue with http_poller after upgrading to 6.0. The config worked fine in previous versions.

I've submitted a ticket to elastic support, I'll try to post here if they provide any additional updates or a fix.

1 Like

We have the same issue as well, we just upgraded to 6.0.0 on our test instance and found this plugin is the only logstash plugin with an issue.

However, we tested with only one url and no additional auth config, and it seemed to work. So, maybe the auth portion is causing an issue. But it seems some folks in this thread have issues without auth enabled.

Hitting this issue as well!

From this https://github.com/logstash-plugins/logstash-input-http_poller/issues/90,
it is already a known issue and they will fix it 6.0.1

1 Like

I have installed 6.0.1 and was then able to use http_poller

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.