# How add processing time to the timestamp and create a new field for it

**URL:** <https://discuss.elastic.co/t/how-add-processing-time-to-the-timestamp-and-create-a-new-field-for-it/90666>\
**Category:** Logstash\
**Created:** [June 23, 2017, 4:00pm UTC](https://discuss.elastic.co/t/how-add-processing-time-to-the-timestamp-and-create-a-new-field-for-it/90666 "2017-06-23T16:00:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tejas\_Ghutukade](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@Tejas\_Ghutukade](https://discuss.elastic.co/u/Tejas_Ghutukade)\
**Post date:** [June 23, 2017, 4:00pm UTC](https://discuss.elastic.co/t/how-add-processing-time-to-the-timestamp-and-create-a-new-field-for-it/90666/1 "2017-06-23T16:00:42Z")

</div>

Hi,

I have field that stores a timestamp and a filed with processing time in milliseconds.

I want to write a filter that adds the preocessing time to the timestamp and create another field the stores the completed timestamp.

Thanks.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 27, 2017, 5:50am UTC](https://discuss.elastic.co/t/how-add-processing-time-to-the-timestamp-and-create-a-new-field-for-it/90666/2 "2017-06-27T05:50:05Z")

</div>

And the timestamp you currently have has second resolution (rather than millisecond resolution)? Create a new field that concatenates the two field values and pass that field to a date filter.

```nohighlight
mutate {
  add_field => {
    "new-timestamp" => "%{old-timestamp} %{milliseconds}"
  }
}
date {
  match => ["new-timestamp", "date pattern that matches your data"]
}

```

This example stores the resulting timestamp in `@timestamp`. The date filter's `target` option can change that.

---

<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 25, 2017, 5:50am UTC](https://discuss.elastic.co/t/how-add-processing-time-to-the-timestamp-and-create-a-new-field-for-it/90666/3 "2017-07-25T05:50:21Z")

</div>

Closed on July 25, 2017, 5:50am UTC

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