# How to index scripted field with curl

**URL:** <https://discuss.elastic.co/t/how-to-index-scripted-field-with-curl/116534>\
**Category:** Kibana\
**Created:** [January 22, 2018, 8:58pm UTC](https://discuss.elastic.co/t/how-to-index-scripted-field-with-curl/116534 "2018-01-22T20:58:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_dob](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dr\_dob](https://discuss.elastic.co/u/dr_dob)\
**Post date:** [January 22, 2018, 8:58pm UTC](https://discuss.elastic.co/t/how-to-index-scripted-field-with-curl/116534/1 "2018-01-22T20:58:19Z")

</div>

How can I index a scripted field to the .kibana index? Something like curl -XPOST '[http://localhost:9200/.kibana/scriptedfield/Test](http://localhost:9200/.kibana/scriptedfield/Test)' -d 'code'

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [January 24, 2018, 3:31pm UTC](https://discuss.elastic.co/t/how-to-index-scripted-field-with-curl/116534/2 "2018-01-24T15:31:23Z")

</div>

Scripted field are part of the index pattern saved object. Unfortunately, there is no current API for partial updates but you could programmatically overwrite the whole object (with the new scripted field included).

I create issue [https://github.com/elastic/kibana/issues/16252](https://github.com/elastic/kibana/issues/16252) to track the enhancement request

Nathan

---

<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, 2018, 3:31pm UTC](https://discuss.elastic.co/t/how-to-index-scripted-field-with-curl/116534/3 "2018-02-21T15:31:31Z")

</div>

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