Not sure how to enable painless regex


I want to enable regex for painless script as it is not enabled by default and hence my scripted field is failing to create. I added "script.painless.regex.enabled" under env section of elasticsearch.yaml file (please see below) that I pass into helm install command but it doesn't work, I am not sure this is syntactically correct. To verify if this setting is taken effect, I enter container and explore content of /usr/share/elasticsearch/config/elasticsearch.yml hoping to see "script.painless.regex.enabled" setting there but I don't see it.

Any thoughts on this is very appreciated.

helm install --namespace logging elasticsearch elastic/elasticsearch -f /root/elk/elasticsearch.yaml


imageTag: 7.4.1
replicas: 1
esJavaOpts: "-Xmx256m -Xms256m"
    cpu: "100m"
    memory: "1G"
    cpu: "1000m"
    memory: "1G"

  - name: script.painless.regex.enabled
    value: "true"


Maybe you might find interesting the Elastic helm charts.

Anyway, there are 2 ways to customize the configuration:

  • editing the elasticsearch.yml
  • using environment variables

Please check if you've correctly enabled the setting using GET /_cluster/settings?include_defaults=true. You should see if it's enabled or not.

1 Like

Perfect. Thanks a lot Luca, it worked. This is what I added:

  elasticsearch.yml: |
    script.painless.regex.enabled: true
1 Like

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