# Add a new field with a specifically formatted timestamp from @timestamp

**URL:** https://discuss.elastic.co/t/add-a-new-field-with-a-specifically-formatted-timestamp-from-timestamp/287373
**Category:** Logstash
**Created:** [October 21, 2021, 11:53pm UTC](https://discuss.elastic.co/t/add-a-new-field-with-a-specifically-formatted-timestamp-from-timestamp/287373 "2021-10-21T23:53:58Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [October 22, 2021, 12:25am UTC](https://discuss.elastic.co/t/add-a-new-field-with-a-specifically-formatted-timestamp-from-timestamp/287373/2 "2021-10-22T00:25:17Z")

</div>

To format a timestamp as a string, use a ruby filter and strftime. There is an example [here](https://discuss.elastic.co/t/changing-time-format/278115/2). To prepend it to the message field you can use

```
mutate { replace => { "message" => "%{[@metadata][someField]} %{message}" } }
```

---

_[View the full topic](https://discuss.elastic.co/t/add-a-new-field-with-a-specifically-formatted-timestamp-from-timestamp/287373)._
