# Moving @timestamp in an optionnal new field

**URL:** https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628
**Category:** Beats
**Tags:** filebeat
**Created:** [May 10, 2016, 9:27am UTC](https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628 "2016-05-10T09:27:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ericpietro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ericpietro/32/9685_2.png) [@ericpietro](https://discuss.elastic.co/u/ericpietro)
#### Post date: [May 10, 2016, 9:27am UTC](https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628/1 "2016-05-10T09:27:12Z")

</div>

hi,  
i want to add a new field in my config filebeat and put in it the @timestamp value :

fields:  
harvest\_timestamp: @timestamp

but it doesn't work ...  
my goal, at the end, is to delete the field @timestamp and just keep the new field 'harvest\_timetamp'. Thus, my logstash shipper, output in my config, will create his own @timestamp... and i will know :  
1 - the harvest timestamp  
2 - the shipping timestamp

A solution exists please ? ty

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [May 10, 2016, 10:54am UTC](https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628/2 "2016-05-10T10:54:54Z")

</div>

you can not rename fields in filebeat directly. You have to do this kind of processing in logstash, but no idea if you can overwrite the `@timestamp` in logstash.

---

<div class="post-metadata">

### Author: ![ericpietro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ericpietro/32/9685_2.png) [@ericpietro](https://discuss.elastic.co/u/ericpietro)
#### Post date: [May 11, 2016, 7:00am UTC](https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628/3 "2016-05-11T07:00:31Z")

</div>

ty steffens for your answer (even if it doesn't help 😂)

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [May 11, 2016, 2:10pm UTC](https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628/4 "2016-05-11T14:10:59Z")

</div>

the timestamp is not set by output plugin, but by input plugins. Using ruby or mutate filter you can try to store `@timestamp` into `harvest_timestamp` and try to overwrite timestamp. Never tried, but with ruby filter you can try

```auto
ruby {
        code => 'event["[@timestamp]"] = Time.now'
}

```

Regarding questions about event processing in logstash, have a look at the logstash forum.

---

<div class="post-metadata">

### Author: ![ericpietro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ericpietro/32/9685_2.png) [@ericpietro](https://discuss.elastic.co/u/ericpietro)
#### Post date: [May 11, 2016, 2:33pm UTC](https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628/5 "2016-05-11T14:33:29Z")

</div>

ty steffens it works !! 😀

---

<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 5, 2017, 9:52pm UTC](https://discuss.elastic.co/t/moving-timestamp-in-an-optionnal-new-field/49628/6 "2017-07-05T21:52:07Z")

</div>


