# How to replace @timestamp field in logstash aggregate filter map

**URL:** https://discuss.elastic.co/t/how-to-replace-timestamp-field-in-logstash-aggregate-filter-map/275708
**Category:** Logstash
**Created:** [June 11, 2021, 6:08pm UTC](https://discuss.elastic.co/t/how-to-replace-timestamp-field-in-logstash-aggregate-filter-map/275708 "2021-06-11T18:08:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jratliff](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jratliff/32/52746_2.png) [@jratliff](https://discuss.elastic.co/u/jratliff)
#### Post date: [June 11, 2021, 6:08pm UTC](https://discuss.elastic.co/t/how-to-replace-timestamp-field-in-logstash-aggregate-filter-map/275708/1 "2021-06-11T18:08:24Z")

</div>

I'm using the logstash aggregate filter. When the map is pushed upon timeout, I want to set the @timestamp field to be a specific valu.

I've tried using timeout\_code =\> event.set('@timestamp', "2021-06-10T19:00:00.000Z").  
I've tried this with Time.utc(2021, 6, 10, 19, 0, 0), and Time.utc(2021, 6, 10, 19, 0, 0).to\_i  
I've tried using the date filter both before and after the aggregate filter.

I either get nothing, or it spews out errors saying it doesn't like me trying to change the @timestamp field.

What can I do to update the @timestamp?

Thanks.

--John

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [June 11, 2021, 7:13pm UTC](https://discuss.elastic.co/t/how-to-replace-timestamp-field-in-logstash-aggregate-filter-map/275708/2 "2021-06-11T19:13:49Z")

</div>

@timestamp has to be a LogStash::Timestamp. You could try

```
event.set("@timestamp", LogStash::Timestamp.new(Time.utc(2021, 6, 10, 19, 0, 0))
```

---

<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 9, 2021, 7:14pm UTC](https://discuss.elastic.co/t/how-to-replace-timestamp-field-in-logstash-aggregate-filter-map/275708/3 "2021-07-09T19:14:21Z")

</div>

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