# Adding new field using an existing field?

**URL:** <https://discuss.elastic.co/t/adding-new-field-using-an-existing-field/72597>\
**Category:** Elasticsearch\
**Created:** [January 24, 2017, 9:19am UTC](https://discuss.elastic.co/t/adding-new-field-using-an-existing-field/72597 "2017-01-24T09:19:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [January 24, 2017, 9:19am UTC](https://discuss.elastic.co/t/adding-new-field-using-an-existing-field/72597/1 "2017-01-24T09:19:39Z")

</div>

I have my mapping as follows:

```
 {
  "payment_transaction": {
    "mappings": {
      "message_logs": {
        "properties": {
          "@timestamp": {
            "type": "date"
          },
          "changed_date": {
            "type": "date"
          },
          "created_date": {
            "type": "date"
          }
        }
      }
    }
  }
}

```

And I need to create new three fields such as ( **year,month,day** ) where the value of ( **created\_date** ) should be trimmed and assigned as in a following manner:

```
year=2016
month=11
day=22

```

The format of the created\_date looks like **2016-11-22T22:20:21.000Z**.

Is this possible? Any help could be appreciated.

---

<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:** [February 21, 2017, 9:19am UTC](https://discuss.elastic.co/t/adding-new-field-using-an-existing-field/72597/2 "2017-02-21T09:19:40Z")

</div>

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