logstash-plugins / logstash-input-http_poller

Create Logstash events by polling HTTP endpoints!
https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http_poller.html
Apache License 2.0
43 stars 65 forks source link

schedule every behavior #125

Open ajrpayne opened 3 years ago

ajrpayne commented 3 years ago

Logstash information:

bin/logstash --version Using bundled JDK logstash 7.12.0

Logstash expanded from tar Ran via command line

5.11.14-1-MANJARO SMP PREEMPT x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

schedule => {
    every => "60"
}

My understanding is that every will execute on start and then every 60 seconds after. Currently, in logstash 7.12 it only starts executing after the 60 seconds is up. It does not perform the first poll on start.

input { http_poller { urls => { statc => { method => get url => "https://www.statc.json?lang=E" headers => { Accept => "application/json" } } } request_timeout => 60 schedule => { every => "60" } codec => "plain" } }

TheVastyDeep commented 8 months ago

"My understanding is that every will execute on start and then every 60 seconds after." The code seems to be using :first_in to do this. That will end up calling this. My understanding of Ruby argument/parameter assignment (acquired this afternoon from here) is that that call should result in the opts argument being set to "{:first_in=>0.01}". Not sure what is not working.