Convert Elasticsearch 1.3.8 with groovy script file

Due to a security vulnerability with ES 1.3.4, we upgraded to ES 1.3.9, which disabled the dynamic groovy script, resulting in conversion conversions not with the "dynamic scripts for [groovy] disabled" error message. I tried the approach at https://www.elastic.co/guide/en/elasticsearch/reference/1.3/modules-scripting.html , putting the appearance of the script in the script file, but the script file will not be called or the transformation does not work. How can we achieve conversion using a script file

The conversion of the display file is as follows:

"transform" : [{
      "script" : "ctx._source['downloadCountInt'] = (ctx._source['downloadCount']==null)? ctx._source['downloadCount'] : ctx._source['downloadCount'].replaceAll(/\\D/, '');",
      "lang" : "groovy"
    }]

I tried to put the script ctx._source['downloadCountInt'] = (ctx._source['downloadCount']==null)? ctx._source['downloadCount'] : ctx._source['downloadCount'].replaceAll(/\\D/, '');in a script file called "transform_download_count.groovy" in / etc / elasticsearch / scripts / transform _download_count.groovy, and the log messages show that it was compiled correctly, but the conversion was never called.

+4
source share
1 answer

Using a script file /etc/elasticsearch/scripts/transform_download_count.groovytry:

"transform" : {
  "script_file" : "transform_download_count",
  "lang" : "groovy"
}
0
source

All Articles