# Copy a date from a filed to a second field

**URL:** <https://discuss.elastic.co/t/copy-a-date-from-a-filed-to-a-second-field/69968>\
**Category:** Logstash\
**Created:** [December 26, 2016, 1:42am UTC](https://discuss.elastic.co/t/copy-a-date-from-a-filed-to-a-second-field/69968 "2016-12-26T01:42:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbruyere](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@sbruyere](https://discuss.elastic.co/u/sbruyere)\
**Post date:** [December 26, 2016, 1:42am UTC](https://discuss.elastic.co/t/copy-a-date-from-a-filed-to-a-second-field/69968/1 "2016-12-26T01:42:06Z")

</div>

Hi,

I need to pass date from a filed to an other to measure time gap between two log file received via Http\_poller.  
I use the Memory plugin and Logstash 5.1.

Here what I've tried :  
if [ColName1] == "Log Time" {  
memorize {  
fields =\> ["This\_Log\_Arrival", "Previous\_Log\_Arrival"]  
}  
mutate {  
rename =\> {"This\_Log\_Arrival" =\> "Previous\_Log\_Arrival"}  
}  
mutate {  
add\_field =\> {"This\_Log\_Arrival" =\> "%{@timestamp}"}  
}  
}

The result of all my tests gave Previous\_Log\_Arrival = This\_Log\_Arrival.

Pleae help 🙂

---

<div class="post-metadata">

**Author:** ![sbruyere](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@sbruyere](https://discuss.elastic.co/u/sbruyere)\
**Post date:** [December 28, 2016, 11:00pm UTC](https://discuss.elastic.co/t/copy-a-date-from-a-filed-to-a-second-field/69968/2 "2016-12-28T23:00:33Z")

</div>

Ok, I found my mistake/misunderstanding. The memorize plugin -I believe- cannot memorize anything between two Http\_pollings. It just memorizes fields and passes them between events of a single Http\_polling.

And I also understood that what I was looking for -Finding the Timestamp of the last entry in Elastic- was easily done with logstash-filter-elasticsearch.

---

<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:** [January 25, 2017, 11:00pm UTC](https://discuss.elastic.co/t/copy-a-date-from-a-filed-to-a-second-field/69968/3 "2017-01-25T23:00:36Z")

</div>

Closed on January 25, 2017, 11:00pm UTC

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