Transform not working in template


(not zippy) #1

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


(Mark Walkom) #2

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


(David Pilato) #3

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


(not zippy) #4

@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


(system) #5