# Add time interval in between each document's timestamp

**URL:** <https://discuss.elastic.co/t/add-time-interval-in-between-each-documents-timestamp/270988>\
**Category:** Logstash\
**Created:** [April 22, 2021, 4:24pm UTC](https://discuss.elastic.co/t/add-time-interval-in-between-each-documents-timestamp/270988 "2021-04-22T16:24:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Fuller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felipe_fuller/32/80377_2.png) [@Felipe\_Fuller](https://discuss.elastic.co/u/Felipe_Fuller)\
**Post date:** [April 22, 2021, 4:24pm UTC](https://discuss.elastic.co/t/add-time-interval-in-between-each-documents-timestamp/270988/1 "2021-04-22T16:24:45Z")

</div>

Hi Community! I hope you're doing great 🙂

I'm struggling to give a 5 seconds window/interval of time between each document inserted to elasticsearch in the timestamp field.

Actually, I have this pipeline:

```auto
input {
  http_poller {
    urls => {
      url => "http://localhost:5000/post/1"
    }
    request_timeout => 60
    schedule => { every => "5m"}
    codec => "json"
    metadata_target => "http_poller_metadata"
  }
}
output {
	elasticsearch {
     	index => "weather"
     	hosts => ["https://elasticsearch:9200"]
     	user => "${ELASTIC_USERNAME}"
     	password => "${ELASTIC_PASSWORD}"
     	ssl => true
     	ssl_certificate_verification => true
     	cacert => '/certs/ca.crt'
     	codec => json_lines
	}
  stdout {}
}

```

Receiving into elasticsearch, documents such as:

```auto
{
    "is_successful": false,
    "@timestamp": "2021-04-20T22:42:08.276Z",
    "ip_address": "0.0.0.1",
}, {
    "is_successful": false,
    "@timestamp": "2021-04-20T22:42:08.276Z",
    "ip_address": "0.0.0.2",
}, {
    "is_successful": true,
    "@timestamp": "2021-04-20T22:42:08.276Z",
    "ip_address": "0.0.0.3",
}

```

So I would like to have 5 seconds in between each `@timestamp`. Such as:

```auto
{
    "is_successful": false,
    "@timestamp": "2021-04-20T22:42:08.276Z",
    "ip_address": "0.0.0.1",
}, {
    "is_successful": false,
    "@timestamp": "2021-04-20T22:42:13.276Z",
    "ip_address": "0.0.0.2",
}, {
    "is_successful": true,
    "@timestamp": "2021-04-20T22:42:18.276Z",
    "ip_address": "0.0.0.3",
}

```

How could I achieve this? any tip to solve it?

Thank you in advance!

---

<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:** [May 20, 2021, 4:25pm UTC](https://discuss.elastic.co/t/add-time-interval-in-between-each-documents-timestamp/270988/2 "2021-05-20T16:25:33Z")

</div>

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