# How to pass timestamp value into other log file

**URL:** https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122
**Category:** Logstash
**Created:** [July 9, 2018, 9:30am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122 "2018-07-09T09:30:08Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![Gokul\_15](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@Gokul\_15](https://discuss.elastic.co/u/Gokul_15)
#### Post date: [July 9, 2018, 10:40am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122/6 "2018-07-09T10:40:31Z")

</div>

> [@Get current time using ruby filter in logstash](https://discuss.elastic.co/t/get-current-time-using-ruby-filter-in-logstash/90084/8):
>
> I was only able to have a similar feature as what you wanted by creating explicit created\_at and updated\_at fields: input { stdin { codec =\> json } } filter { ruby { code =\> "event.set('updated\_date', event.get('@timestamp'))" } } output { elasticsearch { action =\> update document\_id =\> "%{my\_id}" upsert =\> '{ "document\_id": "%{my\_id}", "value": "%{value}", "created\_at": "%{@timestamp}", "updated\_at": "%{@timestamp}" }' } }

---

_[View the full topic](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122)._
