Transform not working in template

Hi

I am having this issue were my transform is NOT making any changes to inserted documents. The script calls a python script. I have determined the following:

  1. The script is called, print out of the ctx and it shows the full map of the document being inserted.
  2. Any changes or additions to the document map are completely ignored

However if I call an update with the same transform block of code that was in the index template, the following is observed

  1. The script is called, print out of the ctx and it shows the full map of the document being inserted.
  2. Any changes or additions to the map are processed.

This appears to be occurring regardless of the language of the script, groovy behaves identically.

Any idea ?

Thanks
Nz

If you can provide your code it could help :slight_smile:

Just a note. We will probably remove that feature in the future. See https://github.com/elastic/elasticsearch/pull/13657

@warkolm
The code

{
"test": {
    "transform": {
        "lang": "python",
        "script_file": "python_test",
    },
  "properties": {
    "simple" : {
     "type":"string"
    }
}

python/test.py

ctx["_source"]["simple"] = "hello"

@dadoonet
I really hope this does not get dropped, as pointed out in github there are cases were it makes sense to have this feature and to rip it out is rather defeating (at least the code that does this is now highlited and perhaps I can determine the issue). In my particular case I wanted to take long & lat data coming in as two seperate fields and transform it into a single field. To have logstash running for the sole purpose of transforming this field is a waste of CPU

Nz