# 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:** 7
**Page:** 1

<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, 9:30am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122/1 "2018-07-09T09:30:08Z")

</div>

hi am new to elk,how to pass timestamp value into other log file  
any body suggestions??

---

<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:10am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122/2 "2018-07-09T10:10:24Z")

</div>

any suggestion??

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 9, 2018, 10:13am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122/3 "2018-07-09T10:13:09Z")

</div>

This forum is manned by volunteers, so please be patient. If you have not received any response within a few days, feel free to bump the issue.

It is not entirely clear to me what you are asking for, so please show an example rather than try to describe what you are looking for.

---

<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:23am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122/4 "2018-07-09T10:23:33Z")

</div>

want to pass current timestamp value into .log file through output ..

sorry for the trouble ..i wont repeat...

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 9, 2018, 10:39am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122/5 "2018-07-09T10:39:32Z")

</div>

I still do not understand. Please show an example.

---

<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}" }' } }

---

<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, 2018, 10:40am UTC](https://discuss.elastic.co/t/how-to-pass-timestamp-value-into-other-log-file/139122/7 "2018-08-06T10:40:31Z")

</div>

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