# Putting server time in the request http poller body logstash

**URL:** https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010
**Category:** Logstash
**Created:** [June 3, 2019, 3:22pm UTC](https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010 "2019-06-03T15:22:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Hiven](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hiven](https://discuss.elastic.co/u/Hiven)
#### Post date: [June 3, 2019, 3:22pm UTC](https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010/1 "2019-06-03T15:22:40Z")

</div>

Hello,

I have a logstash confg with uses http poller. The big problem I have is that, I need the current date sent in the body so the API knows what data to return. It doesn't work with relative dates, it needs the exact date to query.

So, I have tried many different ways to put the current server date in the body field of the request within the logstash.conf. Here is an example:

input{  
http\_poller {  
#proxy =\> { host =\> "" }  
proxy =\> ""  
urls =\> {  
q1 =\> {  
method =\> post  
url =\> ""  
headers =\> {.... }  
body =\> '{  
"rsid": "....",  
"globalFilters": [  
{  
"type": "dateRange",  
"dateRange": "%{+ddMMyyHHmmss}"  
}  
................  
}'  
}  
}  
request\_timeout =\> 60  
# Supports "cron", "every", "at" and "in" schedules by rufus scheduler  
schedule =\> { cron =\> "\* \* \* \* \* UTC"}  
codec =\> "json"  
metadata\_target =\> "http\_poller\_metadata"  
}  
}  
output {  
elasticsearch {  
hosts =\> ["xxxx"]  
index =\> "xxxx"  
}  
}

In every example I try, it just sends the raw value "%{+ddMMyyHHmmss}" and doesn't turn it into the current date. Any help would be really appreciated, I have done extensive searching but cant find the answer.

---

<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: [June 3, 2019, 6:07pm UTC](https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010/2 "2019-06-03T18:07:13Z")

</div>

That appears to be a [known issue](https://github.com/logstash-plugins/logstash-input-http_poller/issues/108).

---

<div class="post-metadata">

### Author: ![Hiven](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hiven](https://discuss.elastic.co/u/Hiven)
#### Post date: [June 3, 2019, 7:04pm UTC](https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010/3 "2019-06-03T19:04:53Z")

</div>

Thank you very much for that. It’s a shame it’s a known issue, is there any way to understand if it’s due to receive a fix any time soon?

---

<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: [June 4, 2019, 6:57pm UTC](https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010/4 "2019-06-04T18:57:36Z")

</div>

> [@Hiven](#):
>
> is there any way to understand if it’s due to receive a fix any time soon?

I wouldn't hold my breath waiting for that 🙂

---

<div class="post-metadata">

### Author: ![Hiven](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hiven](https://discuss.elastic.co/u/Hiven)
#### Post date: [June 6, 2019, 6:59am UTC](https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010/5 "2019-06-06T06:59:15Z")

</div>

Ok I’m now using Nifi which is a lot more powerful.

---

<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: [July 4, 2019, 6:59am UTC](https://discuss.elastic.co/t/putting-server-time-in-the-request-http-poller-body-logstash/184010/6 "2019-07-04T06:59:26Z")

</div>

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