# Can scripted fields be defined in K4 after the fact?

**URL:** <https://discuss.elastic.co/t/can-scripted-fields-be-defined-in-k4-after-the-fact/66>\
**Category:** Kibana\
**Created:** [April 30, 2015, 5:47pm UTC](https://discuss.elastic.co/t/can-scripted-fields-be-defined-in-k4-after-the-fact/66 "2015-04-30T17:47:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [April 30, 2015, 5:47pm UTC](https://discuss.elastic.co/t/can-scripted-fields-be-defined-in-k4-after-the-fact/66/1 "2015-04-30T17:47:32Z")

</div>

In theory, scripted fields could be used to define new fields post hoc. However, with the following caveats:

- Scripted fields are calculated at display time so there are performance implications. For example, something that will be prohibitively slow and not recommended is to retrieve the `_source` field via a scripted field and parsing it to get the not\_analyzed version of a field (instead of defining this in Elasticsearch as part of a `not_analyzed` mapped field for indexing).
- While scripted fields become part of the documents you view in Kibana, they are not part of the Elasticsearch index which means that they cannot be searched.

---

<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 6, 2017, 2:19pm UTC](https://discuss.elastic.co/t/can-scripted-fields-be-defined-in-k4-after-the-fact/66/2 "2017-07-06T14:19:49Z")

</div>


