# How to replace Logstash timestamp with URL request timestamp in Elasticsearch?

**URL:** https://discuss.elastic.co/t/how-to-replace-logstash-timestamp-with-url-request-timestamp-in-elasticsearch/240525
**Category:** Logstash
**Created:** [July 9, 2020, 12:21pm UTC](https://discuss.elastic.co/t/how-to-replace-logstash-timestamp-with-url-request-timestamp-in-elasticsearch/240525 "2020-07-09T12:21:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Rahul\_Chougule](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_chougule/32/71789_2.png) [@Rahul\_Chougule](https://discuss.elastic.co/u/Rahul_Chougule)
#### Post date: [July 9, 2020, 12:21pm UTC](https://discuss.elastic.co/t/how-to-replace-logstash-timestamp-with-url-request-timestamp-in-elasticsearch/240525/1 "2020-07-09T12:21:40Z")

</div>

I have created .conf file where I am ingesting HTTP endpoints output data in Elasticsearch with the help of http\_poller plugin. I want to replace timestamp which is provided by Logstash with the timestamp of at which actual request made for that particular endpoint.

How to use date filter plugin in this case? Please help.

Thanks in advance.

---

<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: [July 9, 2020, 5:01pm UTC](https://discuss.elastic.co/t/how-to-replace-logstash-timestamp-with-url-request-timestamp-in-elasticsearch/240525/2 "2020-07-09T17:01:56Z")

</div>

By default @timestamp is, I believe, added as an event is created. There should not be much difference between that and the time when the http\_poller runs. You can add the currect time using

```
filter {
    ruby {
        code => '
            event.set("date", Time.now.strftime("%Y-%m-%d %H:%M:%S")
        '
    }
}

```

and then parse that with a date filter. But if something is causing delays between creating events and processing them it may cause delays between the execution of the http\_poller and execution of the ruby filter.

---

<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: [August 6, 2020, 5:05pm UTC](https://discuss.elastic.co/t/how-to-replace-logstash-timestamp-with-url-request-timestamp-in-elasticsearch/240525/3 "2020-08-06T17:05:24Z")

</div>

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