# Scripted fields =~ does not work as described in original documentation

**URL:** <https://discuss.elastic.co/t/scripted-fields-does-not-work-as-described-in-original-documentation/235727>\
**Category:** Kibana\
**Created:** [June 4, 2020, 10:14am UTC](https://discuss.elastic.co/t/scripted-fields-does-not-work-as-described-in-original-documentation/235727 "2020-06-04T10:14:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Datakids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/datakids/32/39622_2.png) [@Datakids](https://discuss.elastic.co/u/Datakids)\
**Post date:** [June 4, 2020, 10:14am UTC](https://discuss.elastic.co/t/scripted-fields-does-not-work-as-described-in-original-documentation/235727/1 "2020-06-04T10:14:03Z")

</div>

Hi folks,  
I need a little help here to understand how that works.

Tried with Kibana 7.3.1, 7.6.2. 7.7.0

I've found this:  
Under "Regex" how to script a wildcard

> **[Using Painless in Kibana scripted fields](https://www.elastic.co/de/blog/using-painless-kibana-scripted-fields)**
>
> Dieser Artikel stellt gängige Anwendungsfälle geskripteter Felder in Kibana vor und zeigt, wie ihr sie auf einer Elastic Cloud Instanz verwendet.

Then I took a look inside the 7.7x Documentation and found the same:  
Painless’s native support for regular expressions has syntax constructs:  
[https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-walkthrough.html](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-walkthrough.html)

Then I said ok lets try:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/3/c32157509231280a0d238a2f4b74e00e920e4900.png)

The script is invalid!  
Any suggestions?

So what is the difference between "Documentation" and "Kibana" itself

Please take a look and let me know how to use =~

Thanks  
Regards

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [June 10, 2020, 3:31pm UTC](https://discuss.elastic.co/t/scripted-fields-does-not-work-as-described-in-original-documentation/235727/2 "2020-06-10T15:31:45Z")

</div>

Hi

Are Regexp enabled in your Elasticsearch.yaml, because they are disabled by default. Have a look:

[https://www.elastic.co/guide/en/elasticsearch/painless/7.7/painless-walkthrough.html#modules-scripting-painless-regex](https://www.elastic.co/guide/en/elasticsearch/painless/7.7/painless-walkthrough.html#modules-scripting-painless-regex)

Best,  
Matthias

---

<div class="post-metadata">

**Author:** ![Datakids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/datakids/32/39622_2.png) [@Datakids](https://discuss.elastic.co/u/Datakids)\
**Post date:** [June 11, 2020, 7:30am UTC](https://discuss.elastic.co/t/scripted-fields-does-not-work-as-described-in-original-documentation/235727/3 "2020-06-11T07:30:42Z")

</div>

Hi Matthias,  
yep works 🙂  
Thanks  
Regards  
Thorben

---

<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 9, 2020, 7:30am UTC](https://discuss.elastic.co/t/scripted-fields-does-not-work-as-described-in-original-documentation/235727/4 "2020-07-09T07:30:52Z")

</div>

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