# How to use array variable in regex. Painless scripted field

**URL:** <https://discuss.elastic.co/t/how-to-use-array-variable-in-regex-painless-scripted-field/116527>\
**Category:** Kibana\
**Created:** [January 22, 2018, 7:27pm UTC](https://discuss.elastic.co/t/how-to-use-array-variable-in-regex-painless-scripted-field/116527 "2018-01-22T19:27:25Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [January 22, 2018, 9:59pm UTC](https://discuss.elastic.co/t/how-to-use-array-variable-in-regex-painless-scripted-field/116527/4 "2018-01-22T21:59:13Z")

</div>

Yes, this is how to add one to Kibana.

> [@Scripted field with curl](https://discuss.elastic.co/t/scripted-field-with-curl/106837):
>
> Is it possible to add a scripted filed to an index with curl or in the Kibana console? If yes please post a link or give an example.

saving one is just doing the same and looking for the field name inside the JSON you get from cURL.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-use-array-variable-in-regex-painless-scripted-field/116527)._
