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

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

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

Then I said ok lets try:
image

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

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

Best,
Matthias

1 Like

Hi Matthias,
yep works :slight_smile:
Thanks
Regards
Thorben

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