# Return (emit) @timestamp date value in runtime field

**URL:** <https://discuss.elastic.co/t/return-emit-timestamp-date-value-in-runtime-field/311001>\
**Category:** Kibana\
**Tags:** runtime-fields\
**Created:** [July 29, 2022, 4:08pm UTC](https://discuss.elastic.co/t/return-emit-timestamp-date-value-in-runtime-field/311001 "2022-07-29T16:08:29Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 30, 2022, 2:38pm UTC](https://discuss.elastic.co/t/return-emit-timestamp-date-value-in-runtime-field/311001/6 "2022-07-30T14:38:52Z")

</div>

That is exactly what I showed you... confused... you have to name it as a new field..

You add a new field...this is in the Index Pattern if you which will work for visualizations.

 ![Screen Shot 2022-07-30 at 7.36.02 AM](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b872f4143b37075eaa310a8abd8be6cd73a4d4e.png)

BUT if you actually want to do searches / aggregation etc.. etc.. you need to add it to the mapping

```auto
PUT my-index-000001/
{
  "mappings": {
    "runtime": {
      "date_month_MMM": {
        "type": "keyword",
        "script": {
          "source": "emit(doc['@timestamp'].value.month.getDisplayName(TextStyle.SHORT, Locale.ROOT));"
        }
      }
    }

```

---

_[View the full topic](https://discuss.elastic.co/t/return-emit-timestamp-date-value-in-runtime-field/311001)._
