# Create Scripted Field using substring before "."

**URL:** <https://discuss.elastic.co/t/create-scripted-field-using-substring-before/238096>\
**Category:** Kibana\
**Created:** [June 22, 2020, 1:45pm UTC](https://discuss.elastic.co/t/create-scripted-field-using-substring-before/238096 "2020-06-22T13:45:32Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [June 23, 2020, 11:07am UTC](https://discuss.elastic.co/t/create-scripted-field-using-substring-before/238096/9 "2020-06-23T11:07:39Z")

</div>

> [@Using painless split function in aggregation](https://discuss.elastic.co/t/using-painless-split-function-in-aggregation/153168):
>
> Hello, I am trying to use the painless script split function in my AWS elasticsearch cluster but it does not seem to be working. I get "Unable to find dynamic method [split] with [1] arguments for class [java.lang.String]." Any idea? Many thanks

Ok, looked it up. Apparently you can't use split. Need to use REGEX or another method.

---

_[View the full topic](https://discuss.elastic.co/t/create-scripted-field-using-substring-before/238096)._
