Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to pass Current Date in http_poller request url #128

Open
MaverickNyk opened this issue Jun 5, 2021 · 0 comments
Open

Not able to pass Current Date in http_poller request url #128

MaverickNyk opened this issue Jun 5, 2021 · 0 comments
Labels

Comments

@MaverickNyk
Copy link

MaverickNyk commented Jun 5, 2021

Logstash information:

  1. Logstash version logstash:7.12.1
  2. Logstash installation source : docker.elastic.co/logstash/logstash:7.12.1
  3. How is Logstash being run : docker
  4. How was the Logstash Plugin installed

JVM

  1. JVM version : openJDK 16.0.1
  2. JVM installation source : OS

OS version : Mac OS 11.2

Problem Description:
Getting error while using current date in http_poller URL:

input {
   http_poller {
     urls => {
       urlname_1 => "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id=1&date=%{+YYYY.MM.dd}"
     }
     request_timeout => 30
     schedule => { every =>"300s"}
     codec => "json"
   }
}

Error Logs:

logstash.inputs.http_poller][main] Registering http_poller Input {:type=>nil, :schedule=>{"every"=>"300s"}, :timeout=>nil}
logstash         | [2021-06-05T11:57:45,463][ERROR][logstash.javapipeline    ][main] Pipeline error {:pipeline_id=>"main", :exception=>#<LogStash::ConfigurationError: Invalid URL https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id=1&date=%{+YYYY.MM.dd}>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http_poller-5.0.2/lib/logstash/inputs/http_poller.rb:103:in `validate_request!'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http_poller-5.0.2/lib/logstash/inputs/http_poller.rb:95:in `normalize_request'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http_poller-5.0.2/lib/logstash/inputs/http_poller.rb:55:in `block in setup_requests!'", "org/jruby/RubyHash.java:1415:in `each'", "org/jruby/RubyEnumerable.java:886:in `map'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http_poller-5.0.2/lib/logstash/inputs/http_poller.rb:55:in `setup_requests!'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http_poller-5.0.2/lib/logstash/inputs/http_poller.rb:45:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:228:in `block in register_plugins'", "org/jruby/RubyArray.java:1809:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:227:in `register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:386:in `start_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:311:in `start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:185:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:137:in `block in start'"], "pipeline.sources"=>["/usr/share/logstash/pipeline/logstash.conf"], :thread=>"#<Thread:0x1db629bf run>"}
logstash         | [2021-06-05T11:57:45,465][INFO ][logstash.javapipeline    ][main] Pipeline terminated {"pipeline.id"=>"main"}
logstash         | [2021-06-05T11:57:45,477][ERROR][logstash.agent           ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil}
logstash         | [2021-06-05T11:57:45,532][INFO ][logstash.runner          ] Logstash shut down.

@MaverickNyk MaverickNyk added the bug label Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant