# Adding a new field to an index

**URL:** https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410
**Category:** Elasticsearch
**Created:** [January 17, 2016, 10:18pm UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410 "2016-01-17T22:18:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)
#### Post date: [January 17, 2016, 10:18pm UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410/1 "2016-01-17T22:18:56Z")

</div>

Hello,  
In our elasticsearch index, we have a field time that records the time a document was inserted, we would like to update the index to store this in the default time stamp field (\_timestamp).

Please how can i do that? @warkolm @dadoonet

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 18, 2016, 12:15am UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410/2 "2016-01-18T00:15:14Z")

</div>

The default timestamp field is `@timestamp`.  
Are you using Logstash?

> [@Idarlington](#):
>
> Please how can i do that? @warkolm @dadoonet

Please don't do this, it's very annoying and will likely just see any people you ping ignore you.

---

<div class="post-metadata">

### Author: ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)
#### Post date: [January 18, 2016, 7:31am UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410/3 "2016-01-18T07:31:19Z")

</div>

No we don't currently use logstash.

> [@warkolm](#):
>
> Please don't do this, it's very annoying and will likely just see any people you ping ignore you

OK, thanks for informing me.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 18, 2016, 7:58am UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410/4 "2016-01-18T07:58:07Z")

</div>

What are you using then?

---

<div class="post-metadata">

### Author: ![Idarlington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/idarlington/32/19887_2.png) [@Idarlington](https://discuss.elastic.co/u/Idarlington)
#### Post date: [January 18, 2016, 8:44am UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410/5 "2016-01-18T08:44:35Z")

</div>

We just have an elasticsearch index, we are planning to use elastalert for alerting and it (elastalert) requires the @timestamp field for sorting.

---

<div class="post-metadata">

### Author: ![daddyyankee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daddyyankee/32/19259_2.png) [@daddyyankee](https://discuss.elastic.co/u/daddyyankee)
#### Post date: [June 19, 2017, 2:49pm UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410/6 "2017-06-19T14:49:06Z")

</div>

I've had to normalize times across logs, you want to keep the timestamp field, but might have an operation parsing out the date to match a particular format. You can

in your GROK section add the following two lines:  
date { match =\> ["timestamp", "MMM d HH:mm:ss"] } #or whatever you want your timestamp field to appear as, and make sure the MMM d.. matches how your embedded timestamp looks in your file. overwrites timestamp

add\_field =\> ["received\_at", "%{@timestamp}"] #preserves the original time the file was received

---

<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: [November 4, 2022, 4:12am UTC](https://discuss.elastic.co/t/adding-a-new-field-to-an-index/39410/7 "2022-11-04T04:12:57Z")

</div>


