# Dynamic variable in Http\_poller url

**URL:** <https://discuss.elastic.co/t/dynamic-variable-in-http-poller-url/249943>\
**Category:** Logstash\
**Created:** [September 25, 2020, 9:34am UTC](https://discuss.elastic.co/t/dynamic-variable-in-http-poller-url/249943 "2020-09-25T09:34:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hiba/32/110919_2.png) [@hiba](https://discuss.elastic.co/u/hiba)\
**Post date:** [September 25, 2020, 9:34am UTC](https://discuss.elastic.co/t/dynamic-variable-in-http-poller-url/249943/1 "2020-09-25T09:34:39Z")

</div>

Hi all,

i try to make the endDate in the url , dynamic ( take the date of the system) ?

but i got error in logstash .

[2020-09-25T10:24:22,616][INFO][logstash.outputs.elasticsearch][main] Attempting to install template {:manage\_template=\>{"index\_patterns"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s", "number\_of\_shards"=\>1}, "mappings"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}  
[2020-09-25T10:24:23,459][INFO][logstash.javapipeline][main] Pipeline Java execution initialization time {"seconds"=\>0.86}  
[2020-09-25T10:24:23,482][INFO][logstash.inputs.http\_poller][main] Registering http\_poller Input {:type=\>nil, :schedule=\>{"every"=\>"60s"}, :timeout=\>nil}  
[2020-09-25T10:24:24,475][ERROR][logstash.agent] Failed to execute action {:id=\>:main, :action\_type=\>LogStash::ConvergeResult::FailedAction, :message=\>"Could not execute action: PipelineAction::Create, action\_result: false", :backtrace=\>nil}  
[2020-09-25T10:24:24,981][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}  
[2020-09-25T10:24:29,686][INFO][logstash.runner] Logstash shut down.  
[2020-09-25T10:24:29,712][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

and this is my config file:  
input {

```
http_poller {
	urls => {
		url2020 => "http://XXXXXXXXXXXX?startDate=01/01/2020&endDate=%{now}"
	}
	request_timeout => 60
	schedule => { "every" => "60s" }
	codec => "json"
}

```

}

can someone help me please !  
Hiba.

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [September 25, 2020, 10:05am UTC](https://discuss.elastic.co/t/dynamic-variable-in-http-poller-url/249943/2 "2020-09-25T10:05:56Z")

</div>

Not sure if this is possible as part of the input plugin  
I am pretty sure that is possible in filter  
May be @Badger can have an idea

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [September 25, 2020, 2:03pm UTC](https://discuss.elastic.co/t/dynamic-variable-in-http-poller-url/249943/3 "2020-09-25T14:03:13Z")

</div>

See [this](https://discuss.elastic.co/t/get-service-now-com-data/244320/2) answer.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 23, 2020, 2:03pm UTC](https://discuss.elastic.co/t/dynamic-variable-in-http-poller-url/249943/4 "2020-10-23T14:03:24Z")

</div>

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