Http-pooler issue . Cannot send API call

Hi Folks ,
I have some issue with my configuration . I'm not able to get data in my elastic cluster . I'm using the configuration below
input {
http_poller {
urls => {
method => get
headers => { X-xxx-APIToken => "apitoken" }
url => "https://xxxx.ne.xxx.com/api/xxx/v2/xxx-groups/?ssl=22"
}
truststore => "/usr/share/logstash/certs/logstash/arbor-lab.jks"
truststore_password => "${JKS_TRUSTSTORE_PASSWORD}"
tags => ["xxx-api"]
schedule => { cron => "* * * * * UTC" }
keepalive => false
codec => "json"
}
}
output {
elasticsearch {
hosts => ["https://es01:9200"]
index => "arbor-metric-%{+YYYY.MM.dd}"
ssl => true
ssl_certificate_verification => true
cacert => "/usr/share/logstash/certs/ca/ca.crt"
index => "arbor-metric-%{+YYYY.MM.dd}"
user => "elastic"
password => "${ELASTIC_PASSWORD}"
ilm_policy => "delete-after-120days"
}
}

Error that I get

[2019-10-10T18:24:06,318][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Exp
ected one of #, -, ", ', } at line 7, column 73 (byte 137) after input {\n http_poller {\n\n urls => {\n\n\t\t\t\t\t\t\t method => get\n he
aders => { ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in compile_graph'", "/us
r/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:in map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in comp ile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:in initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/ java_pipeline.rb:24:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:325:in block in
converge_state'"]}
[2019-10-10T18:24:09,356][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Exp
ected one of #, -, ", ', } at line 7, column 73 (byte 137) after input {\n http_poller {\n\n urls => {\n\n\t\t\t\t\t\t\t method => get\n

logstash | [2019-10-10T18:31:52,870][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, -, ", ', } at line 7, column 73 (byte 137) after input {\n http_poller {\n\n urls => {\n\n\t\t\t\t\t\t\t method => get\n headers => { ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2577:in map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:151:in initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:24:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:325:in block in converge_state'"]}

That should be

http_poller {
    urls => {
        randomname => {
            method => get
            headers => { X-xxx-APIToken => "apitoken" }
            url => "https://xxxx.ne.xxx.com/api/xxx/v2/xxx-groups/?ssl=22"
        }
    }

Thanks Badger , It's seem to be fixed

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